From bc897bbab2c6efca02b2b79b0d91334667331915 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 6 Dec 2023 16:51:25 +0100 Subject: [PATCH] 111 --- playbooks/sync_all.yaml | 11 ++++++++++- playbooks/sync_container_data.yaml | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 9304109..31d4641 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,6 +3,13 @@ hosts: containers gather_facts: false tasks: + - include_tasks: stop_containers.yaml + name: Stop Containers + when: inventory_hostname in groups['raspberrypi5'] + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 + - include_tasks: sync_container_data.yaml name: Sync Container Data - include_tasks: reconfigure_nginx.yaml @@ -28,4 +35,6 @@ ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true when: inventory_hostname in groups['raspberrypi5'] - \ No newline at end of file + - include_tasks: start_containers.yaml + name: Start Containers + when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 3a375af..870747e 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -3,6 +3,7 @@ become: true when: inventory_hostname in groups['raspberry'] or inventory_hostname in groups['raspberrypi5'] - name: Syncing all - ansible.builtin.shell: 'rsync -ra /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} admin@192.168.77.238:/share/docker_data/ --exclude='home-assistant.log*' --exclude='gitlab/logs/*' + #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} admin@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} admin@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] \ No newline at end of file