38 lines
905 B
YAML
38 lines
905 B
YAML
---
|
|
# tasks file for keepalived
|
|
|
|
- name: Deploy configuration
|
|
ansible.builtin.template:
|
|
src: keepalived.j2
|
|
dest: /etc/keepalived/keepalived.conf
|
|
owner: root
|
|
group: root
|
|
mode: u=rw,g=r,o=r
|
|
become: true
|
|
notify: Restart keepalived.service
|
|
|
|
- name: Deploy sudoers configuration
|
|
ansible.builtin.template:
|
|
src: sudoers.j2
|
|
dest: /etc/sudoers.d/keepalived_script
|
|
owner: root
|
|
group: keepalived_script
|
|
mode: u=rwx,g=rx,o=
|
|
validate: /usr/sbin/visudo -cf %s
|
|
when:
|
|
- keepalived_notify_enable
|
|
- keepalived_sudoers_cmd | length > 0
|
|
become: true
|
|
notify: Restart keepalived.service
|
|
|
|
- name: Deploy notify script
|
|
ansible.builtin.template:
|
|
src: notify.bash.j2
|
|
dest: /etc/keepalived/notify.bash
|
|
owner: root
|
|
group: keepalived_script
|
|
mode: u=rwx,g=rx,o=
|
|
when: keepalived_notify_enable
|
|
become: true
|
|
notify: Restart keepalived.service
|