forked from evolix/ansible-roles
vrrpd : configure and restart minifirewall before starting VRRP
This commit is contained in:
parent
5acb1956f5
commit
7a9be8d6fa
|
@ -19,6 +19,7 @@ The **patch** part is incremented if multiple releases happen the same month
|
||||||
* evolinux-base: Add new variable to disable global customisation of bash config
|
* evolinux-base: Add new variable to disable global customisation of bash config
|
||||||
* roundcube: Use /var/log/roundcube directly
|
* roundcube: Use /var/log/roundcube directly
|
||||||
* evolinux-users: Add sudo mvcli for nagios user
|
* evolinux-users: Add sudo mvcli for nagios user
|
||||||
|
* vrrpd : configure and restart minifirewall before starting VRRP
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: set unit name
|
# Configure and restart minifirewall before starting the VRRP service
|
||||||
ansible.builtin.set_fact:
|
|
||||||
vrrp_systemd_unit_name: "vrrp-{{ vrrp_address.id }}.service"
|
|
||||||
|
|
||||||
- name: add systemd unit
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: vrrp.service.j2
|
|
||||||
dest: "/etc/systemd/system/{{ vrrp_systemd_unit_name }}"
|
|
||||||
force: true
|
|
||||||
register: vrrp_systemd_unit
|
|
||||||
|
|
||||||
- name: enable and start systemd unit
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: "{{ vrrp_systemd_unit_name }}"
|
|
||||||
daemon_reload: yes
|
|
||||||
enabled: yes
|
|
||||||
state: "{{ vrrp_address.state }}"
|
|
||||||
when:
|
|
||||||
- vrrp_systemd_unit is changed
|
|
||||||
- not ansible_check_mode
|
|
||||||
|
|
||||||
- name: Check if a recent minifirewall is present
|
- name: Check if a recent minifirewall is present
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
|
@ -55,3 +36,31 @@
|
||||||
loop_var: peer
|
loop_var: peer
|
||||||
notify: "{{ minifirewall_restart_handler_name }}"
|
notify: "{{ minifirewall_restart_handler_name }}"
|
||||||
when: _minifirewall_dir.stat.exists
|
when: _minifirewall_dir.stat.exists
|
||||||
|
|
||||||
|
- name: Flush handlers to restart minifirewall
|
||||||
|
ansible.builtin.meta: flush_handlers
|
||||||
|
when: _minifirewall_dir.stat.exists
|
||||||
|
|
||||||
|
|
||||||
|
# Configure VRRP service
|
||||||
|
|
||||||
|
- name: set unit name
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
vrrp_systemd_unit_name: "vrrp-{{ vrrp_address.id }}.service"
|
||||||
|
|
||||||
|
- name: add systemd unit
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: vrrp.service.j2
|
||||||
|
dest: "/etc/systemd/system/{{ vrrp_systemd_unit_name }}"
|
||||||
|
force: true
|
||||||
|
register: vrrp_systemd_unit
|
||||||
|
|
||||||
|
- name: enable and start systemd unit
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: "{{ vrrp_systemd_unit_name }}"
|
||||||
|
daemon_reload: yes
|
||||||
|
enabled: yes
|
||||||
|
state: "{{ vrrp_address.state }}"
|
||||||
|
when:
|
||||||
|
- vrrp_systemd_unit is changed
|
||||||
|
- not ansible_check_mode
|
||||||
|
|
Loading…
Reference in a new issue