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