52 lines
1.0 KiB
YAML
52 lines
1.0 KiB
YAML
---
|
|
|
|
- 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
|
|
|
|
|