2023-09-15 14:04:30 +02:00
|
|
|
- hosts: containers
|
2023-11-01 01:51:24 +01:00
|
|
|
name: Switch mailu to primary
|
2023-09-15 14:04:30 +02:00
|
|
|
ignore_unreachable: false
|
|
|
|
vars:
|
|
|
|
arch_name: docker_mailu2_data
|
2023-11-01 01:53:49 +01:00
|
|
|
containers:
|
|
|
|
- nginx-app-1
|
|
|
|
- heimdall
|
|
|
|
- mailu2-admin-1
|
|
|
|
- mailu2-antispam-1
|
|
|
|
- mailu2-antivirus-1
|
|
|
|
- mailu2-fetchmail-1
|
|
|
|
- mailu2-front-1
|
|
|
|
- mailu2-imap-1
|
|
|
|
- mailu2-oletools-1
|
|
|
|
- mailu2-redis-1
|
|
|
|
- mailu2-resolver-1
|
|
|
|
- mailu2-smtp-1
|
2023-11-01 02:02:29 +01:00
|
|
|
- mailu2-webdav-1
|
|
|
|
- mailu2-webmail-1
|
|
|
|
- HomeAssistant
|
|
|
|
- mosquitto-mosquitto-1
|
2023-12-09 15:50:11 +01:00
|
|
|
- gitlab
|
|
|
|
- semaphore-app-1
|
|
|
|
- semaphore-db-1
|
2023-09-15 14:04:30 +02:00
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: Get ruleset
|
|
|
|
command: nvram get vts_rulelist
|
|
|
|
when: inventory_hostname in groups['router']
|
|
|
|
register: ruleset
|
|
|
|
|
|
|
|
- name: Set new ruleset
|
2023-09-15 14:11:49 +02:00
|
|
|
command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.246', '192.168.77.106') }}"
|
2023-09-15 14:04:30 +02:00
|
|
|
when: inventory_hostname in groups['router']
|
|
|
|
|
|
|
|
- name: Nvram commit
|
|
|
|
command: nvram commit
|
|
|
|
when: inventory_hostname in groups['router']
|
|
|
|
|
|
|
|
- name: Restart firewall
|
|
|
|
command: service restart_firewall
|
|
|
|
when: inventory_hostname in groups['router']
|
|
|
|
|
2023-11-01 01:02:00 +01:00
|
|
|
# - name: Stop mailu rasp
|
|
|
|
# uri:
|
|
|
|
# url: "http://192.168.77.106:9000/api/stacks/{{ item }}/stop?endpointId=2"
|
|
|
|
# method: POST
|
|
|
|
# body_format: form-urlencoded
|
|
|
|
# return_content: yes
|
|
|
|
# headers:
|
|
|
|
# Content-Type: "application/json"
|
|
|
|
# X-API-Key: "ptr_DfS2M6Fj2P3fVvYpkhE0KJh2UGCzY47ePaFaLqadsjg="
|
|
|
|
# timeout: 60
|
|
|
|
# ignore_errors: yes
|
|
|
|
# when: inventory_hostname in groups['nas']
|
|
|
|
# loop:
|
|
|
|
# - 130
|
|
|
|
# - 149
|
|
|
|
# #- 140
|
|
|
|
# - 180
|
2023-09-15 14:04:30 +02:00
|
|
|
|
2023-11-01 01:02:00 +01:00
|
|
|
- name: Stop mailu containers
|
2023-12-09 15:50:11 +01:00
|
|
|
command: "docker stop {{ containers | join(' ') }}"
|
2023-11-01 01:33:21 +01:00
|
|
|
become: true
|
2023-11-01 01:55:47 +01:00
|
|
|
ignore_errors: true
|
|
|
|
when: inventory_hostname in groups['raspberry']
|