2017-03-14 22:43:13 +01:00
|
|
|
|
2018-10-03 19:00:29 +02:00
|
|
|
# IMPORTANT: after the IP that is 2 TABULATOR characters !
|
|
|
|
- name: Replacing appropriate jail names with new IP addresses in /etc/hosts files (IPv4)
|
2017-03-14 22:43:13 +01:00
|
|
|
lineinfile:
|
2019-09-12 14:17:45 +02:00
|
|
|
dest: /etc/hosts
|
2019-01-13 16:33:53 +01:00
|
|
|
regexp: '^\d+\.\d+\.\d+\.\d+ jail-{{ jail_name.replace("_", "-") }}'
|
|
|
|
line: '{{ vars["jail_" + jail_name + "_new_ip4"] }} jail-{{ jail_name.replace("_", "-") }}'
|
2017-03-14 22:43:13 +01:00
|
|
|
state: present
|
2017-03-15 02:51:58 +01:00
|
|
|
|
2018-10-03 19:00:29 +02:00
|
|
|
- block:
|
|
|
|
# IMPORTANT: after the IP that is 2 TABULATOR characters !
|
|
|
|
- name: Replacing appropriate jail names with new IP addresses in /etc/hosts files (IPv6)
|
|
|
|
lineinfile:
|
2019-09-12 14:17:45 +02:00
|
|
|
dest: /etc/hosts
|
2019-01-13 16:33:53 +01:00
|
|
|
regexp: '^[0-9a-f:]+ jail-{{ jail_name.replace("_", "-") }}'
|
|
|
|
line: '{{ jail_THIS_with_ip6 }} jail-{{ jail_name.replace("_", "-") }}'
|
2018-10-03 19:00:29 +02:00
|
|
|
state: present
|
|
|
|
when: 'jail_THIS_with_ip6 != False'
|
|
|
|
|
2019-09-01 15:40:55 +02:00
|
|
|
- name: Sending HUP to any any crucial processes to reload their configuration
|
2021-05-16 20:12:06 +02:00
|
|
|
ansible.builtin.command:
|
2019-01-13 21:37:23 +01:00
|
|
|
/usr/bin/killall -HUP dnsmasq
|
2017-03-15 02:51:58 +01:00
|
|
|
failed_when: false
|
2019-01-13 21:37:23 +01:00
|
|
|
|
|
|
|
- name: Restarting syslog to put its log socket into the new jail
|
|
|
|
service:
|
|
|
|
name: syslogd
|
|
|
|
state: restarted
|
|
|
|
|
2019-09-01 17:12:05 +02:00
|
|
|
# vim: sw=2
|