ansible-role-keepalived/tasks/main.yml

26 lines
532 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: true
tags: keepalived