diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 3e222d8..9304109 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -1,11 +1,31 @@ -- hosts: containers - name: Sync mailu,ha,... - ignore_unreachable: false +--- +- name: import a task + hosts: containers + gather_facts: false tasks: - - name: Changing permission - ansible.builtin.shell: 'chown -R admin. /share/docker_data/' + - include_tasks: sync_container_data.yaml + name: Sync Container Data + - include_tasks: reconfigure_nginx.yaml + name: Reconfigure nginx proxy manager + loop: + - sectorq.eu + - gitlab.sectorq.eu + - ha.sectorq.eu + - mail.sectorq.eu + - pw.sectorq.eu + - semaphore.sectorq.eu + when: inventory_hostname in groups['raspberrypi5'] + + - include_tasks: reconfigure_heimdall.yaml + name: Reconfigure heimdall + loop: + - Home Assistant + - Nginx Proxy Manager + - Portainer + - Roundcube + when: inventory_hostname in groups['raspberrypi5'] + - name: Changing heimdall background + 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['raspberry'] or inventory_hostname in groups['raspberrypi5'] - - name: Syncing all - ansible.builtin.shell: 'rsync -ra /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx} admin@192.168.77.238:/share/docker_data/' - when: inventory_hostname in groups['nas'] \ No newline at end of file + when: inventory_hostname in groups['raspberrypi5'] + \ No newline at end of file diff --git a/playbooks/test.yaml b/playbooks/test.yaml index 935f9f8..cfde9a5 100644 --- a/playbooks/test.yaml +++ b/playbooks/test.yaml @@ -1,7 +1,10 @@ -- hosts: containers - name: Stop mailu +- hosts: datacenter + name: Modify nginx configs + vars: + apps: + - Home Assistant tasks: - - name: Copy archive - ansible.builtin.shell: 'scp -i .ssh/id_rsa333 /share/Data/dockers-{{ ansible_date_time.date }}.tar.gz jaydee@192.168.77.246/share/' - ignore_errors: yes - when: inventory_hostname in groups['nas'] \ No newline at end of file + - include: reconfigure_heimdall.yaml app={{ item }} + name: lala + with_items: + - "{{ apps }}" \ No newline at end of file