mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-01-23 20:39:26 +00:00
111
This commit is contained in:
parent
9a203c242e
commit
6ef97997fa
72
playbooks/mailu_switch_to_second2.yaml
Normal file
72
playbooks/mailu_switch_to_second2.yaml
Normal file
@ -0,0 +1,72 @@
|
||||
- hosts: containers
|
||||
name: Switch mailu to second
|
||||
|
||||
ignore_unreachable: false
|
||||
vars:
|
||||
arch_name: docker_mailu2_data
|
||||
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
|
||||
- mailu2-webdav-1
|
||||
- mailu2-webmail-1
|
||||
- HomeAssistant
|
||||
- mosquitto-mosquitto-1
|
||||
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: Start mailu containers
|
||||
command: "docker restart {{ containers | join(' ') }}"
|
||||
become: true
|
||||
ignore_errors: true
|
||||
when: inventory_hostname in groups['raspberrypi5']
|
||||
|
||||
- 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.238') }}"
|
||||
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']
|
||||
|
||||
|
||||
|
||||
|
||||
|
26
playbooks/raspberrypi5_setup.yaml
Normal file
26
playbooks/raspberrypi5_setup.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
- hosts: containers
|
||||
name: Sync mailu
|
||||
ignore_unreachable: false
|
||||
tasks:
|
||||
- name: Stop swap
|
||||
ansible.builtin.shell: 'dphys-swapfile swapoff'
|
||||
become: true
|
||||
when: inventory_hostname in groups['raspberrypi5']
|
||||
- name: Reconfigure swap size
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/dphys-swapfile
|
||||
regexp: "^CONF_SWAPSIZE=.*"
|
||||
line: "CONF_SWAPSIZE=2048"
|
||||
become: true
|
||||
when: inventory_hostname in groups['raspberrypi5']
|
||||
- name: Start swap
|
||||
ansible.builtin.shell: 'dphys-swapfile swapon'
|
||||
become: true
|
||||
when: inventory_hostname in groups['raspberrypi5']
|
||||
|
||||
- name: Disable wayland for vnc
|
||||
ansible.builtin.shell: 'raspi-config nonint do_wayland W1'
|
||||
become: true
|
||||
when: inventory_hostname in groups['raspberrypi5']
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user