ansible-role-keepalived/tasks/main.yml

27 lines
531 B
YAML
Raw Normal View History

2019-04-12 16:29:11 +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
- 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
notify: restart keepalived
tags: keepalived
- 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
enabled: yes
tags: keepalived