ansible/playbooks/sync_container_data.yaml

17 lines
1.2 KiB
YAML
Raw Normal View History

2024-11-14 11:13:49 +01:00
---
2023-12-06 15:19:27 +01:00
- name: Changing permission
2024-03-13 09:51:16 +01:00
ansible.builtin.shell: 'chown -R root. /share/docker_data/'
2023-12-06 15:19:27 +01:00
become: true
2024-11-14 12:22:52 +01:00
when: inventory_hostname == destination_server
- debug:
2024-11-14 16:40:51 +01:00
msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"
2024-11-15 13:28:22 +01:00
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/*"
2024-11-15 13:30:36 +01:00
when: inventory_hostname == source_server and selected_containers|split(",")|length == 1
2024-11-14 12:50:43 +01:00
2023-12-06 15:19:27 +01:00
- name: Syncing all
2024-11-14 12:50:43 +01:00
ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"
2024-03-13 09:51:16 +01:00
#ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"'
2023-12-06 15:19:27 +01:00
#ansible.builtin.shell: 'ls -la'
2024-11-14 12:22:52 +01:00
when: inventory_hostname == source_server