added reload and restart handlers

netsplit
Niklas Yann Wettengel 7 years ago
parent 62a74b1ed4
commit cb3abd5574

@ -0,0 +1,10 @@
---
- name: reload iptables
systemd:
name: iptables.service
state: reloaded
- name: reload ip6tables
systemd:
name: ip6tables.service
state: reloaded

@ -3,24 +3,22 @@
copy:
src: iptables.rules
dest: /etc/iptables/iptables.rules
register: iptables_rules
notify: reload iptables
- name: start and enable iptables service
when: iptables_rules.changed
systemd:
name: iptables.service
enabled: yes
state: reloaded
state: started
- name: copy ip6tables.rules
copy:
src: ip6tables.rules
dest: /etc/iptables/ip6tables.rules
register: ip6tables_rules
notify: reload ip6tables
- name: start and enable ip6tables service
when: ip6tables_rules.changed
systemd:
name: ip6tables.service
enabled: yes
state: reloaded
state: started

@ -0,0 +1,5 @@
---
- name: restart systemd-journald
systemd:
name: systemd-journald.service
state: restarted

@ -4,10 +4,4 @@
path: /etc/systemd/journald.conf
regexp: '^#?Storage='
line: 'Storage=volatile'
register: journald_conf
- name: restart systemd-journald
when: journald_conf.changed
systemd:
name: systemd-journald.service
state: restarted
notify: restart systemd-journald

@ -0,0 +1,3 @@
---
- name: reload ff-sysctl
command: /usr/bin/sysctl -p /etc/sysctl.d/ff.conf

@ -9,8 +9,4 @@
copy:
src: ff.conf
dest: /etc/sysctl.d/ff.conf
register: ff_conf
- name: reload sysctl
when: ff_conf.changed
command: /usr/bin/sysctl -p /etc/sysctl.d/ff.conf
notify: reload ff-sysctl

@ -0,0 +1,5 @@
---
- name: reload bind
systemd:
name: named.service
state: reloaded

@ -15,10 +15,4 @@
template:
src: named.conf.j2
dest: /etc/named.conf
register: named_conf
- name: reload bind
when: named_conf.changed
systemd:
name: named.service
state: reloaded
notify: reload bind

@ -0,0 +1,5 @@
---
- name: restart dhcpd4
systemd:
name: dhcpd4.service
state: restarted

@ -27,3 +27,4 @@
template:
src: dhcpd.conf.j2
dest: /etc/dhcpd.conf
notify: restart dhcpd4

@ -0,0 +1,10 @@
---
- name: reload fastd
systemd:
name: fastd@ffmyk.service
state: reloaded
- name: restart fastd
systemd:
name: fastd@ffmyk.service
state: restarted

@ -16,6 +16,8 @@
src: fastd.conf.j2
dest: /etc/fastd/ffmyk/fastd.conf
mode: 0640
notify: restart fastd
- name: create backbone folder
file:
path: /etc/fastd/ffmyk/backbone
@ -41,6 +43,7 @@
- fastd13
- fastd14
- fastd15
notify: reload fastd
- name: add fastd bin folder
file:
@ -52,6 +55,7 @@
src: fastd_up.sh.j2
dest: /etc/fastd/ffmyk/bin/up.sh
mode: 0744
notify: restart fastd
- name: add fastd peers folder
file:

@ -0,0 +1,5 @@
---
- name: restart munin-node
systemd:
name: munin-node.service
state: restarted

@ -8,6 +8,7 @@
template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf
notify: restart munin-node
- name: copy fastd plugin
copy:
@ -25,11 +26,13 @@
copy:
src: munin/munin_fastd_conf
dest: /etc/munin/plugin-conf.d/fastd
notify: restart munin-node
- name: copy global config
copy:
src: munin/munin_global_conf
dest: /etc/munin/plugin-conf.d/global
notify: restart munin-node
- name: install netstat
pacman:
@ -52,6 +55,7 @@
src: /usr/lib/munin/plugins/{{ item.plugin | default( item.name ) }}
state: link
with_items: "{{ munin_node_plugins }}"
notify: restart munin-node
- name: start and enable munin-node
systemd:

@ -48,17 +48,11 @@
copy:
src: vnstat
dest: /etc/nginx/sites-available/vnstat
register: nginx_config
notify: reload nginx
- name: enable vnstat nginx config
file:
src: /etc/nginx/sites-available/vnstat
dest: /etc/nginx/sites-enabled/vnstat
state: link
- name: reload nginx
when: nginx_config.changed
systemd:
name: nginx.service
state: reloaded
notify: reload nginx

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

@ -8,6 +8,7 @@
copy:
src: nginx.conf
dest: /etc/nginx/nginx.conf
notify: reload nginx
- name: add sites-available folder
file:

@ -0,0 +1,5 @@
---
- name: restart openvpn
systemd:
name: openvpn-client@mullvad.service
state: restarted

@ -8,32 +8,38 @@
copy:
src: ca.crt
dest: /etc/openvpn/client/ca.crt
notify: restart openvpn
- name: install crl.pem
copy:
src: crl.pem
dest: /etc/openvpn/client/crl.pem
notify: restart openvpn
- name: install mullvad-up.sh
copy:
src: mullvad-up.sh
dest: /etc/openvpn/client/mullvad-up.sh
mode: 0744
notify: restart openvpn
- name: install mullvad.conf
template:
src: mullvad.conf.j2
dest: /etc/openvpn/client/mullvad.conf
notify: restart openvpn
- name: install mullvad.key
template:
src: mullvad.key.j2
dest: /etc/openvpn/client/mullvad.key
notify: restart openvpn
- name: install mullvad.crt
template:
src: mullvad.crt.j2
dest: /etc/openvpn/client/mullvad.crt
notify: restart openvpn
- name: create sysetmd openvpn folder
file:

Loading…
Cancel
Save