26 lines
531 B
YAML
26 lines
531 B
YAML
---
|
|
- name: install package
|
|
ansible.builtin.package:
|
|
name:
|
|
- keepalived
|
|
retries: 2
|
|
register: result
|
|
until: result is succeeded
|
|
tags: keepalived
|
|
|
|
- name: copy configuration file
|
|
ansible.builtin.template:
|
|
src: keepalived.conf.j2
|
|
dest: /etc/keepalived/keepalived.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0600
|
|
notify: restart keepalived
|
|
tags: keepalived
|
|
|
|
- name: enable and start the service
|
|
ansible.builtin.service:
|
|
name: keepalived
|
|
state: started
|
|
enabled: yes
|
|
tags: keepalived
|