Created basic playbook skeleton and setup scripts
This commit is contained in:
51
roles/client/tasks/main.yml
Normal file
51
roles/client/tasks/main.yml
Normal 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user