diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index f7a8575..f09378b 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -5,7 +5,10 @@ when: inventory_hostname == destination_server - debug: msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - when: inventory_hostname == source_server + when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 +- debug: + msg: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + when: inventory_hostname == source_server and selected_containers|split(",")|length = 1 - name: Syncing all ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"