added reload and restart handlers

netsplit
Niklas Yann Wettengel 8 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: copy:
src: iptables.rules src: iptables.rules
dest: /etc/iptables/iptables.rules dest: /etc/iptables/iptables.rules
register: iptables_rules notify: reload iptables
- name: start and enable iptables service - name: start and enable iptables service
when: iptables_rules.changed
systemd: systemd:
name: iptables.service name: iptables.service
enabled: yes enabled: yes
state: reloaded state: started
- name: copy ip6tables.rules - name: copy ip6tables.rules
copy: copy:
src: ip6tables.rules src: ip6tables.rules
dest: /etc/iptables/ip6tables.rules dest: /etc/iptables/ip6tables.rules
register: ip6tables_rules notify: reload ip6tables
- name: start and enable ip6tables service - name: start and enable ip6tables service
when: ip6tables_rules.changed
systemd: systemd:
name: ip6tables.service name: ip6tables.service
enabled: yes 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 path: /etc/systemd/journald.conf
regexp: '^#?Storage=' regexp: '^#?Storage='
line: 'Storage=volatile' line: 'Storage=volatile'
register: journald_conf notify: restart systemd-journald
- name: restart systemd-journald
when: journald_conf.changed
systemd:
name: systemd-journald.service
state: restarted

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

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

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

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

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

@ -27,3 +27,4 @@
template: template:
src: dhcpd.conf.j2 src: dhcpd.conf.j2
dest: /etc/dhcpd.conf 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 src: fastd.conf.j2
dest: /etc/fastd/ffmyk/fastd.conf dest: /etc/fastd/ffmyk/fastd.conf
mode: 0640 mode: 0640
notify: restart fastd
- name: create backbone folder - name: create backbone folder
file: file:
path: /etc/fastd/ffmyk/backbone path: /etc/fastd/ffmyk/backbone
@ -41,6 +43,7 @@
- fastd13 - fastd13
- fastd14 - fastd14
- fastd15 - fastd15
notify: reload fastd
- name: add fastd bin folder - name: add fastd bin folder
file: file:
@ -52,6 +55,7 @@
src: fastd_up.sh.j2 src: fastd_up.sh.j2
dest: /etc/fastd/ffmyk/bin/up.sh dest: /etc/fastd/ffmyk/bin/up.sh
mode: 0744 mode: 0744
notify: restart fastd
- name: add fastd peers folder - name: add fastd peers folder
file: file:

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

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

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

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

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

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

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

Loading…
Cancel
Save