From 389ae647de0c3005a451bada74d257b4ade2f06b Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:01:26 +0100 Subject: [PATCH] bitwarden --- playbooks/sync_all.yaml | 3 ++- playbooks/sync_container_data.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 7039923..32c94fd 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -27,6 +27,7 @@ - include_tasks: sync_container_data.yaml name: Sync Container Data + when: inventory_hostname == source_server - include_tasks: reconfigure_nginx.yaml name: Reconfigure nginx proxy manager @@ -40,7 +41,7 @@ - kestra.sectorq.eu - auth.sectorq.eu when: inventory_hostname == destination_server - + - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 2e5bb83..0638895 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -2,21 +2,21 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - 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 and selected_containers|split(",")|length > 1 + when: 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 + when: 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/*" #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/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 + when: 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/*" #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/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname == source_server and selected_containers|split(",")|length == 1 \ No newline at end of file + when: selected_containers|split(",")|length == 1 \ No newline at end of file