network: Write keepalived interface status to file
This commit is contained in:
parent
d6cc79dcb3
commit
043104f062
4 changed files with 60 additions and 1 deletions
|
@ -45,6 +45,50 @@
|
|||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
||||
- name: Create keepalived group
|
||||
ansible.builtin.group:
|
||||
name: keepalived
|
||||
system: true
|
||||
when:
|
||||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
||||
- name: Create keepalived user
|
||||
ansible.builtin.user:
|
||||
name: keepalived
|
||||
comment: Service keepalived
|
||||
createhome: false
|
||||
group: keepalived
|
||||
home: /var/empty
|
||||
shell: /sbin/nologin
|
||||
system: true
|
||||
when:
|
||||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
||||
- name: Create run directory
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/tmpfiles.d/keepalived.conf
|
||||
content: "d /run/keepalived 755 keepalived keepalived"
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: Refresh keepalived run directory
|
||||
when:
|
||||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
||||
- name: Copy keepalived notify script
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/local/libexec/keepalived-notify
|
||||
src: keepalived-notify.sh
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
when:
|
||||
- network_vip_interfaces is defined
|
||||
- network_vip_interfaces != []
|
||||
|
||||
- name: Create keepalived config
|
||||
ansible.builtin.template:
|
||||
dest: /etc/keepalived/keepalived.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue