mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
lala
This commit is contained in:
parent
69f719f5c4
commit
6361d8528a
50
playbooks/mailu_switch_to_primary.yaml
Normal file
50
playbooks/mailu_switch_to_primary.yaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
- hosts: containers
|
||||||
|
name: Stop mailu
|
||||||
|
ignore_unreachable: false
|
||||||
|
vars:
|
||||||
|
arch_name: docker_mailu2_data
|
||||||
|
tasks:
|
||||||
|
- name: Start mailu rasp
|
||||||
|
uri:
|
||||||
|
url: "http://192.168.77.106:9000/api/stacks/{{ item }}/start?endpointId=13"
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Get ruleset
|
||||||
|
command: nvram get vts_rulelist
|
||||||
|
when: inventory_hostname in groups['router']
|
||||||
|
register: ruleset
|
||||||
|
|
||||||
|
- name: Pause for 60 seconds
|
||||||
|
ansible.builtin.pause:
|
||||||
|
seconds: 60
|
||||||
|
|
||||||
|
- name: Set new ruleset
|
||||||
|
command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.106', '192.168.77.246') }}"
|
||||||
|
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']
|
||||||
|
args:
|
||||||
|
warn: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
50
playbooks/mailu_switch_to_second.yaml
Normal file
50
playbooks/mailu_switch_to_second.yaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
- hosts: containers
|
||||||
|
name: Stop mailu
|
||||||
|
ignore_unreachable: false
|
||||||
|
vars:
|
||||||
|
arch_name: docker_mailu2_data
|
||||||
|
tasks:
|
||||||
|
- name: Start mailu rasp
|
||||||
|
uri:
|
||||||
|
url: "http://192.168.77.106:9000/api/stacks/{{ item }}/start?endpointId=13"
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Get ruleset
|
||||||
|
command: nvram get vts_rulelist
|
||||||
|
when: inventory_hostname in groups['router']
|
||||||
|
register: ruleset
|
||||||
|
|
||||||
|
- name: Pause for 60 seconds
|
||||||
|
ansible.builtin.pause:
|
||||||
|
seconds: 60
|
||||||
|
|
||||||
|
- name: Set new ruleset
|
||||||
|
command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.106', '192.168.77.246') }}"
|
||||||
|
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']
|
||||||
|
args:
|
||||||
|
warn: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user