This commit is contained in:
jaydee 2023-12-06 15:18:07 +01:00
parent e176463b90
commit fd22cf7a1a
2 changed files with 38 additions and 15 deletions

View File

@ -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']
when: inventory_hostname in groups['raspberrypi5']

View File

@ -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']
- include: reconfigure_heimdall.yaml app={{ item }}
name: lala
with_items:
- "{{ apps }}"