run controller-side backup tasks without become to fix rsync permissions
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
state: directory
|
||||
mode: "0750"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Create remote backup directory on host
|
||||
ansible.builtin.file:
|
||||
@@ -63,6 +64,7 @@
|
||||
dest: "{{ app_backup_path }}/{{ app_name }}-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
|
||||
mode: pull
|
||||
when: remote_backup is succeeded
|
||||
become: false
|
||||
|
||||
- name: Clean old backups on controller
|
||||
ansible.builtin.find:
|
||||
@@ -71,6 +73,7 @@
|
||||
age: "{{ app_backup_retention_days_controller | default(90) }}d"
|
||||
register: old_backups_controller
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Remove old backups from controller
|
||||
ansible.builtin.file:
|
||||
@@ -78,6 +81,7 @@
|
||||
state: absent
|
||||
loop: "{{ old_backups_controller.files | default([]) }}"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Clean old backups on remote host
|
||||
ansible.builtin.find:
|
||||
|
||||
Reference in New Issue
Block a user