From f934a8866158bf82d685051d770c48c6fc2e1db4 Mon Sep 17 00:00:00 2001 From: Tobias Hachmer Date: Fri, 13 Oct 2017 07:28:41 +0200 Subject: [PATCH] Move all handlers to one single role --- playbooks/gateways.yml | 1 + roles/handlers/handlers/main.yml | 79 +++++++++++++++++++ roles/network-batman/handlers/main.yml | 5 -- roles/network-fastd/handlers/main.yml | 5 -- roles/network-ffrl/handlers/main.yml | 5 -- .../handlers/main.yml | 6 -- roles/network-meshbridge/handlers/main.yml | 10 --- roles/network-routing/handlers/main.yml | 9 --- roles/service-bind-slave/handlers/main.yml | 9 --- roles/service-bird-ffrl/handlers/main.yml | 10 --- roles/service-bird-icvpn/handlers/main.yml | 10 --- roles/service-bird/handlers/main.yml | 14 ---- roles/service-dhcpd/handlers/main.yml | 6 -- .../service-fastd-intragate/handlers/main.yml | 8 -- roles/service-fastd-mesh/handlers/main.yml | 8 -- roles/service-fastd/handlers/main.yml | 4 - roles/service-radvd/handlers/main.yml | 5 -- roles/service-tinc/handlers/main.yml | 6 -- 18 files changed, 80 insertions(+), 120 deletions(-) create mode 100644 roles/handlers/handlers/main.yml delete mode 100644 roles/network-batman/handlers/main.yml delete mode 100644 roles/network-fastd/handlers/main.yml delete mode 100644 roles/network-ffrl/handlers/main.yml delete mode 100644 roles/network-iptables-gateway/handlers/main.yml delete mode 100644 roles/network-meshbridge/handlers/main.yml delete mode 100644 roles/network-routing/handlers/main.yml delete mode 100644 roles/service-bind-slave/handlers/main.yml delete mode 100644 roles/service-bird-ffrl/handlers/main.yml delete mode 100644 roles/service-bird-icvpn/handlers/main.yml delete mode 100644 roles/service-bird/handlers/main.yml delete mode 100644 roles/service-dhcpd/handlers/main.yml delete mode 100644 roles/service-fastd-intragate/handlers/main.yml delete mode 100644 roles/service-fastd-mesh/handlers/main.yml delete mode 100644 roles/service-fastd/handlers/main.yml delete mode 100644 roles/service-radvd/handlers/main.yml delete mode 100644 roles/service-tinc/handlers/main.yml diff --git a/playbooks/gateways.yml b/playbooks/gateways.yml index b2303d5..84de721 100755 --- a/playbooks/gateways.yml +++ b/playbooks/gateways.yml @@ -3,6 +3,7 @@ - hosts: ffmwu-gateways remote_user: admin roles: + - handlers - prerequisites - server-repos - server-basic diff --git a/roles/handlers/handlers/main.yml b/roles/handlers/handlers/main.yml new file mode 100644 index 0000000..e666ba5 --- /dev/null +++ b/roles/handlers/handlers/main.yml @@ -0,0 +1,79 @@ +--- +- 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 isc dhcp server + systemd: + name: isc-dhcp-server + enabled: yes + state: restarted + +- 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 + enabled: yes + state: restarted + +- name: restart systemd unit ffmwu-static-routes + systemd: + name: ffmwu-static-routes + state: restarted + +- name: iptables-restore + shell: iptables-restore < /etc/iptables/rules.v4 + +- name: ip6tables-restore + shell: ip6tables-restore < /etc/iptables/rules.v6 diff --git a/roles/network-batman/handlers/main.yml b/roles/network-batman/handlers/main.yml deleted file mode 100644 index 191d07d..0000000 --- a/roles/network-batman/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: reload network interfaces - systemd: - name: networking - state: reloaded diff --git a/roles/network-fastd/handlers/main.yml b/roles/network-fastd/handlers/main.yml deleted file mode 100644 index 191d07d..0000000 --- a/roles/network-fastd/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: reload network interfaces - systemd: - name: networking - state: reloaded diff --git a/roles/network-ffrl/handlers/main.yml b/roles/network-ffrl/handlers/main.yml deleted file mode 100644 index 191d07d..0000000 --- a/roles/network-ffrl/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: reload network interfaces - systemd: - name: networking - state: reloaded diff --git a/roles/network-iptables-gateway/handlers/main.yml b/roles/network-iptables-gateway/handlers/main.yml deleted file mode 100644 index 5dfa033..0000000 --- a/roles/network-iptables-gateway/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: iptables-restore - shell: iptables-restore < /etc/iptables/rules.v4 - -- name: ip6tables-restore - shell: ip6tables-restore < /etc/iptables/rules.v6 diff --git a/roles/network-meshbridge/handlers/main.yml b/roles/network-meshbridge/handlers/main.yml deleted file mode 100644 index a07c6fa..0000000 --- a/roles/network-meshbridge/handlers/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: activate sysfs variables - systemd: - name: sysfsutils - state: restarted - -- name: reload network interfaces - systemd: - name: networking - state: reloaded diff --git a/roles/network-routing/handlers/main.yml b/roles/network-routing/handlers/main.yml deleted file mode 100644 index c18c7a6..0000000 --- a/roles/network-routing/handlers/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: reload systemd - systemd: - daemon_reload: yes - -- name: restart systemd unit ffmwu-static-routes - systemd: - name: ffmwu-static-routes - state: restarted diff --git a/roles/service-bind-slave/handlers/main.yml b/roles/service-bind-slave/handlers/main.yml deleted file mode 100644 index e1b2000..0000000 --- a/roles/service-bind-slave/handlers/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: reload systemd - systemd: - daemon_reload: yes - -- name: restart bind9 - systemd: - name: bind9 - state: restarted diff --git a/roles/service-bird-ffrl/handlers/main.yml b/roles/service-bird-ffrl/handlers/main.yml deleted file mode 100644 index a9d5fb3..0000000 --- a/roles/service-bird-ffrl/handlers/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: reload systemd unit bird - systemd: - name: bird - state: reloaded - -- name: reload systemd unit bird6 - systemd: - name: bird6 - state: reloaded diff --git a/roles/service-bird-icvpn/handlers/main.yml b/roles/service-bird-icvpn/handlers/main.yml deleted file mode 100644 index a9d5fb3..0000000 --- a/roles/service-bird-icvpn/handlers/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: reload systemd unit bird - systemd: - name: bird - state: reloaded - -- name: reload systemd unit bird6 - systemd: - name: bird6 - state: reloaded diff --git a/roles/service-bird/handlers/main.yml b/roles/service-bird/handlers/main.yml deleted file mode 100644 index 3d840fc..0000000 --- a/roles/service-bird/handlers/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- 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 diff --git a/roles/service-dhcpd/handlers/main.yml b/roles/service-dhcpd/handlers/main.yml deleted file mode 100644 index f7d522c..0000000 --- a/roles/service-dhcpd/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: restart isc dhcp server - systemd: - name: isc-dhcp-server - enabled: yes - state: restarted diff --git a/roles/service-fastd-intragate/handlers/main.yml b/roles/service-fastd-intragate/handlers/main.yml deleted file mode 100644 index f61c999..0000000 --- a/roles/service-fastd-intragate/handlers/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: restart fastd intragate instances - systemd: - name: "fastd@{{ item.0.id }}igVPN-{{ item.1.mtu }}" - state: restarted - with_subelements: - - "{{ meshes }}" - - fastd.intragate.instances diff --git a/roles/service-fastd-mesh/handlers/main.yml b/roles/service-fastd-mesh/handlers/main.yml deleted file mode 100644 index c7357c1..0000000 --- a/roles/service-fastd-mesh/handlers/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: restart fastd mesh instances - systemd: - name: "fastd@{{ item.0.id }}VPN-{{ item.1.mtu }}" - state: restarted - with_subelements: - - "{{ meshes }}" - - fastd.nodes.instances diff --git a/roles/service-fastd/handlers/main.yml b/roles/service-fastd/handlers/main.yml deleted file mode 100644 index bb7fde2..0000000 --- a/roles/service-fastd/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: reload systemd - systemd: - daemon_reload: yes diff --git a/roles/service-radvd/handlers/main.yml b/roles/service-radvd/handlers/main.yml deleted file mode 100644 index a534dd6..0000000 --- a/roles/service-radvd/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: restart systemd unit radvd - systemd: - name: radvd - state: restarted diff --git a/roles/service-tinc/handlers/main.yml b/roles/service-tinc/handlers/main.yml deleted file mode 100644 index 9293bc9..0000000 --- a/roles/service-tinc/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: restart systemd unit tinc - systemd: - name: tinc - enabled: yes - state: restarted