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:
Tobias Reisinger 2024-10-14 18:30:24 +02:00
parent dc398ddb6e
commit 4104057771
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
123 changed files with 91 additions and 39 deletions
playbooks/roles/backup/tasks

View 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