Use file module instead of shell to change file ownership.
This commit is contained in:
@@ -34,8 +34,10 @@
|
||||
label: "{{ item.key }}"
|
||||
|
||||
- name: Change ownership of volume backups
|
||||
shell: chown chris:chris {{ backup_dir }}/{{ item.value.container }}/{{ item.key }}-{{ ansible_date_time.iso8601_basic_short }}.tar.gz
|
||||
become: true
|
||||
file:
|
||||
path: {{ backup_dir }}/{{ item.value.container }}/{{ item.key }}-{{ ansible_date_time.iso8601_basic_short }}.tar.gz
|
||||
owner: chris
|
||||
group: chris
|
||||
loop: "{{ lookup('dict', volumes) }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
|
||||
Reference in New Issue
Block a user