Use file module instead of shell to change file ownership.
This commit is contained in:
@@ -34,8 +34,10 @@
|
|||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|
||||||
- name: Change ownership of volume backups
|
- 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
|
file:
|
||||||
become: true
|
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: "{{ lookup('dict', volumes) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user