Files
fedora-infra_ansible/roles/keepalived/tasks/main.yml
Kevin Fenzi a32f8b9e4a Change ansible_fqdn to inventory_hostname. This fixes some few hosts that have incorrect reverse dns
and shouldn't break any others since we always use fully qualified in our inventory.
2016-05-11 15:08:50 +00:00

38 lines
933 B
YAML

#
# role for keepalived
# This role needs several variables defined:
#
# keepalived_interface - interface to listen on
# keepalived_priority - priority of this host
# keepalived_ipaddress - virtual ip address on master host
#
- name: Install keepalived package
yum: state=present name=keepalived
tags:
- packages
- keepalived
- name: Install keepalived template
template: src=keepalived.conf.j2 dest=/etc/keepalived/keepalived.conf
tags:
- config
- keepalived
notify:
- restart keepalived
- name: Install keepalived failover script for host (or default)
copy: src={{ item }} dest=/usr/local/bin/keepalived-notify.sh mode=755
with_first_found:
- keepalived-notify.sh.{{ inventory_hostname }}
- keepalived-notify.sh
tags:
- config
- keepalived
- name: Make sure keepalived is set to start and is running
service: state=running enabled=true name=keepalived
tags:
- service
- keepalived