Use file module instead of shell to change file ownership.

This commit is contained in:
2021-11-19 10:16:41 +01:00
parent aa82f93975
commit 9da6f0edf8

View File

@@ -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 }}"