Fix pre-commit hooks and move directories
roles/ and inventory/ are now in playbooks/ also fixed issues reported by ansible-lint
This commit is contained in:
parent
dc398ddb6e
commit
4104057771
123 changed files with 91 additions and 39 deletions
playbooks/roles/backup/tasks
46
playbooks/roles/backup/tasks/main.yml
Normal file
46
playbooks/roles/backup/tasks/main.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ role_name }}
|
||||
vars:
|
||||
yml: "{{ backup_yml }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Template the main backup script
|
||||
ansible.builtin.template:
|
||||
src: backup.sh.j2
|
||||
dest: "{{ (service_path, 'backup.sh') | path_join }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Template autorestic.yml
|
||||
ansible.builtin.template:
|
||||
src: yml.j2
|
||||
dest: "{{ (service_path, '.autorestic.yml') | path_join }}"
|
||||
mode: "0644"
|
||||
|
||||
- name: Template autorestic.all.yml
|
||||
ansible.builtin.template:
|
||||
src: yml.j2
|
||||
dest: "{{ (service_path, '.autorestic.all.yml') | path_join }}"
|
||||
mode: "0644"
|
||||
vars:
|
||||
yml: "{{ backup_yml_all }}"
|
||||
|
||||
- name: Import tasks specific to the hooks scripts
|
||||
ansible.builtin.import_tasks: hooks.yml
|
||||
- name: Import tasks specific to systemd
|
||||
ansible.builtin.import_tasks: systemd.yml
|
||||
|
||||
- name: Verify service
|
||||
ansible.builtin.command:
|
||||
cmd: autorestic -v check
|
||||
chdir: "{{ service_path }}"
|
||||
changed_when: false
|
||||
become: true
|
||||
register: cmd_result_verify
|
||||
until: "cmd_result_verify is not failed"
|
||||
retries: 10
|
||||
delay: 10
|
Loading…
Add table
Add a link
Reference in a new issue