diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 501fe46..a6f6a7b 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -79,11 +79,8 @@ - mosquitto-mosquitto-1" when: '"mosquitto" in selected_containers' - name: Add elements to a list - set_fact: - docker_containers: "{{ docker_containers | default([]) + [item] }}" - loop: - - mosquitto-mosquitto-1" - when: '"ha" in selected_containers' + + - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 0638895..70955aa 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -2,7 +2,8 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - + vars: + selected_containers: "{{ selected_containers|replace('homeassistant' ,'ha') }}" - debug: msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" when: selected_containers|split(",")|length > 1