Created basic playbook skeleton and setup scripts

This commit is contained in:
Elia Farin
2025-12-16 16:15:29 -06:00
parent 24f742fbbe
commit d7dec88cf6
15 changed files with 331 additions and 1 deletions

View File

@@ -0,0 +1,51 @@
---
- name: Update system
ansible.builtin.dnf5:
name: "*"
state: latest
- name: Install borgbackup
ansible.builtin.dnf5:
name: borgbackup
state: present
- name: Create directory structure
ansible.builtin.file:
path: "{{ item.path }}"
owner: root
group: root
mode: "{{ item.mode }}"
state: directory
loop: "{{ install_dirs }}"
- name: Install backup script
ansible.builtin.file:
path: /opt/backup/bin/backup.sh
owner: root
group: root
mode: 0755
- name: Install environment for path
ansible.builtin.command:
cmd: "echo 'source /etc/backupenv' >> /etc/environment && touch /opt/backup/etc/environment_created"
creates: /opt/backup/etc/environment_created
- name: Install path environment file
ansible.builtin.file:
path: /etc/backupenv
owner: root
group: root
mode: 0644
- name: Install environment file
ansible.builtin.template:
src: borg_env.j2
dest: /opt/backup/etc/borg_env
backup: yes
owner: root
group: root
mode: 0600