network: Add keepalived support
This commit is contained in:
parent
a1d4d732ba
commit
d187472f27
3 changed files with 48 additions and 0 deletions
|
@ -15,3 +15,25 @@
|
|||
group: "{{ ansible_wheel }}"
|
||||
notify: reload network manager connections
|
||||
with_items: "{{ network_interfaces }}"
|
||||
|
||||
- block:
|
||||
- name: install keepalived
|
||||
package:
|
||||
name: keepalived
|
||||
state: installed
|
||||
- name: create keepalived config
|
||||
template:
|
||||
dest: /etc/keepalived/keepalived.conf
|
||||
src: keepalived.conf.j2
|
||||
mode: 0600
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: restart keepalived
|
||||
- name: enable keepalived
|
||||
service:
|
||||
name: keepalived
|
||||
state: started
|
||||
enabled: true
|
||||
when:
|
||||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue