2019-04-12 16:29:11 +00:00
|
|
|
---
|
2023-06-29 14:25:21 +00:00
|
|
|
- name: Install package
|
2021-08-18 16:40:55 +00:00
|
|
|
ansible.builtin.package:
|
|
|
|
name:
|
|
|
|
- keepalived
|
2019-04-12 16:29:11 +00:00
|
|
|
retries: 2
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
tags: keepalived
|
|
|
|
|
2023-06-29 14:25:21 +00:00
|
|
|
- name: Copy configuration file
|
2021-08-18 16:40:55 +00:00
|
|
|
ansible.builtin.template:
|
2019-04-12 16:29:11 +00:00
|
|
|
src: keepalived.conf.j2
|
|
|
|
dest: /etc/keepalived/keepalived.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
2023-06-29 14:25:21 +00:00
|
|
|
notify: Restart keepalived
|
2019-04-12 16:29:11 +00:00
|
|
|
tags: keepalived
|
|
|
|
|
2023-06-29 14:25:21 +00:00
|
|
|
- name: Enable and start the service
|
2021-08-18 16:40:55 +00:00
|
|
|
ansible.builtin.service:
|
2019-04-12 16:29:11 +00:00
|
|
|
name: keepalived
|
|
|
|
state: started
|
2023-06-29 14:25:21 +00:00
|
|
|
enabled: true
|
2019-04-12 16:29:11 +00:00
|
|
|
tags: keepalived
|