updatre..

This commit is contained in:
2022-06-15 02:10:25 +02:00
parent d1629137c8
commit e580f3623a
5 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,20 @@
- name: Restart ulogd
service:
name: ulogd
state: restarted
- name: Restart IPv4 Firewall
service:
name: ipt-firewall
state: restarted
when:
- interfaces_ipv4_exists.stat.exists
- main_ipv4_exists.stat.exists
- name: Restart IPv6 Firewall
service:
name: ip6t-firewall
state: restarted
when:
- interfaces_ipv6_exists.stat.exists
- main_ipv6_exists.stat.exists

View File

@ -0,0 +1,77 @@
---
# ---
# Set some facts
# ---
- name: (modify-munin-ip) Set fact_sshd_kexalgorithms (comma separated list)
set_fact:
fact_munin_node_ipv4: "{{ munin_remote_ipv4 | replace('.', '\\.') }}"
when:
- munin_remote_ipv4 is defined and munin_remote_ipv4 | length > 0
- name: (modify-munin-ip - main.yml)) Set fact_sshd_kexalgorithms (comma separated list)
set_fact:
fact_munin_node_ipv4_old: "{{ munin_remote_ipv4 | replace('.', '\\.') }}"
when:
- munin_remote_ipv4_old is defined and munin_remote_ipv4_old | length > 0
# ---
# Some Checks
# ---
- name: (modify-munin-ip) Check if file '/etc/ipt-firewall/main_ipv4.conf' exists
stat:
path: /etc/ipt-firewall/main_ipv4.conf
register: main_ipv4_exists
- name: Check if /etc/ipt-firewall/interfaces_ipv4.conf are present
stat:
path: /etc/ipt-firewall/interfaces_ipv4.conf
register: interfaces_ipv4_exists
- name: Check if /etc/ipt-firewall/interfaces_ipv6.conf are present
stat:
path: /etc/ipt-firewall/interfaces_ipv6.conf
register: interfaces_ipv6_exists
- name: Check if file '/etc/ipt-firewall/main_ipv6.conf' exists
stat:
path: /etc/ipt-firewall/main_ipv6.conf
register: main_ipv6_exists
- name: (modify-munin-ip) Check if file '/etc/munin/munin-node.conf' exists
stat:
path: /etc/munin/munin-node.conf
register: munin_node__exists
- name: (modify-munin-ip) /etc/ipt-firewall/main_ipv4.conf - addjust line 'munin_remote_ip' (IPv4)
lineinfile:
path: /etc/ipt-firewall/main_ipv4.conf
regexp: '^munin_remote_ip='
line: 'munin_remote_ip="{{ munin_remote_ipv4 }}"'
when:
- main_ipv4_exists.stat.exists
notify:
- Restart IPv4 Firewall
- name: (modify-munin-ip) /etc/ipt-firewall/main_ipv6.conf - addjust line 'munin_remote_ip' (IPv6)
lineinfile:
path: /etc/ipt-firewall/main_ipv6.conf
regexp: '^munin_remote_ip='
line: 'munin_remote_ip="{{ munin_remote_ipv6 }}"'
when:
- main_ipv6_exists.stat.exists
notify:
- Restart IPv6 Firewall