Handlers: move all handlers into their roles, again

This commit is contained in:
Tobias Hachmer 2018-03-01 06:34:55 +01:00
parent 2fbaea9e37
commit 886cdb2417
22 changed files with 159 additions and 90 deletions

View file

@ -3,7 +3,6 @@
- hosts: ffmwu-gateways - hosts: ffmwu-gateways
remote_user: admin remote_user: admin
roles: roles:
- handlers
- prerequisites - prerequisites
- server-apt-repos - server-apt-repos
- server-basic - server-basic

View file

@ -1,89 +0,0 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: reload network interfaces
systemd:
name: networking
state: reloaded
- name: activate sysfs variables
systemd:
name: sysfsutils
state: restarted
- name: restart bind9
systemd:
name: bind9
state: restarted
- name: reload systemd unit bird
systemd:
name: bird
state: reloaded
- name: reload systemd unit bird6
systemd:
name: bird6
state: reloaded
- name: restart fastd intragate instances
systemd:
name: "fastd@{{ item.0.id }}igvpn-{{ item.1.mtu }}"
state: restarted
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances
- name: restart fastd mesh instances
systemd:
name: "fastd@{{ item.0.id }}vpn-{{ item.1.mtu }}"
state: restarted
with_subelements:
- "{{ meshes }}"
- fastd.nodes.instances
- name: restart systemd unit radvd
systemd:
name: radvd
state: restarted
- name: restart respondd
systemd:
name: "respondd-{{ item.id }}"
state: restarted
with_items: "{{ meshes }}"
- name: restart systemd unit tinc
systemd:
name: "tinc@{{ icvpn.interface }}"
enabled: yes
state: restarted
- name: restart systemd unit ffmwu-static-routes
systemd:
name: ffmwu-static-routes
state: restarted
- name: restart systemd unit ffmwu-ip-rules
systemd:
name: ffmwu-ip-rules
state: restarted
- name: restart respondd
systemd:
name: "respondd-{{ item.id }}"
state: restarted
with_items: "{{ meshes }}"
- name: iptables-restore
shell: iptables-restore < /etc/iptables/rules.v4
- name: ip6tables-restore
shell: ip6tables-restore < /etc/iptables/rules.v6
- name: reload nginx
systemd:
name: nginx
state: reloaded

View file

@ -0,0 +1,5 @@
---
- name: reload network interfaces
systemd:
name: networking
state: reloaded

View file

@ -0,0 +1,5 @@
---
- name: reload network interfaces
systemd:
name: networking
state: reloaded

View file

@ -0,0 +1,5 @@
---
- name: reload network interfaces
systemd:
name: networking
state: reloaded

View file

@ -0,0 +1,6 @@
---
- name: iptables-restore
shell: iptables-restore < /etc/iptables/rules.v4
- name: ip6tables-restore
shell: ip6tables-restore < /etc/iptables/rules.v6

View file

@ -0,0 +1,10 @@
---
- name: reload network interfaces
systemd:
name: networking
state: reloaded
- name: activate sysfs variables
systemd:
name: sysfsutils
state: restarted

View file

@ -0,0 +1,14 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart systemd unit ffmwu-static-routes
systemd:
name: ffmwu-static-routes
state: restarted
- name: restart systemd unit ffmwu-ip-rules
systemd:
name: ffmwu-ip-rules
state: restarted

View file

@ -0,0 +1,4 @@
---
- name: reload systemd
systemd:
daemon_reload: yes

View file

@ -0,0 +1,9 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart bind9
systemd:
name: bind9
state: restarted

View file

@ -0,0 +1,10 @@
---
- name: reload systemd unit bird
systemd:
name: bird
state: reloaded
- name: reload systemd unit bird6
systemd:
name: bird6
state: reloaded

View file

@ -0,0 +1,14 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: reload systemd unit bird
systemd:
name: bird
state: reloaded
- name: reload systemd unit bird6
systemd:
name: bird6
state: reloaded

View file

@ -0,0 +1,10 @@
---
- name: reload systemd unit bird
systemd:
name: bird
state: reloaded
- name: reload systemd unit bird6
systemd:
name: bird6
state: reloaded

View file

@ -1,4 +1,8 @@
--- ---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart kea-dhcp4-server - name: restart kea-dhcp4-server
systemd: systemd:
name: kea-dhcp4-server name: kea-dhcp4-server

View file

@ -0,0 +1,8 @@
---
- name: restart fastd intragate instances
systemd:
name: "fastd@{{ item.0.id }}igvpn-{{ item.1.mtu }}"
state: restarted
with_subelements:
- "{{ meshes }}"
- fastd.intragate.instances

View file

@ -0,0 +1,12 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart fastd mesh instances
systemd:
name: "fastd@{{ item.0.id }}vpn-{{ item.1.mtu }}"
state: restarted
with_subelements:
- "{{ meshes }}"
- fastd.nodes.instances

View file

@ -0,0 +1,4 @@
---
- name: reload systemd
systemd:
daemon_reload: yes

View file

@ -0,0 +1,9 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: reload nginx
systemd:
name: nginx
state: reloaded

View file

@ -0,0 +1,5 @@
---
- name: reload nginx
systemd:
name: nginx
state: reloaded

View file

@ -0,0 +1,5 @@
---
- name: restart systemd unit radvd
systemd:
name: radvd
state: restarted

View file

@ -0,0 +1,10 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart respondd
systemd:
name: "respondd-{{ item.id }}"
state: restarted
with_items: "{{ meshes }}"

View file

@ -0,0 +1,10 @@
---
- name: reload systemd
systemd:
daemon_reload: yes
- name: restart systemd unit tinc
systemd:
name: "tinc@{{ icvpn.interface }}"
enabled: yes
state: restarted