[keepalived][0] is a free implementation of the Virtual Router Redundancy Protocol (VRRP), which is a simple method for automatically assigning an IP address to one of several potential hosts based on certain criteria. It is particularly useful in conjunction with a load balancer like HAProxy, to provide layer 3 redundancy in addition to layer 7. We will use it for both the reverse proxy for the public websites and the Kubernetes API server. [0]: https://www.keepalived.org/
35 lines
600 B
YAML
35 lines
600 B
YAML
- name: ensure keepalived is installed
|
|
package:
|
|
name: keepalived
|
|
state: present
|
|
tags:
|
|
- install
|
|
|
|
- name: ensure keepalived is configured
|
|
template:
|
|
src: keepalived.conf.j2
|
|
dest: /etc/keepalived/keepalived.conf
|
|
owner: root
|
|
group: root
|
|
mode: u=rw,go=r
|
|
notify: reload keepalived
|
|
tags:
|
|
- config
|
|
|
|
- name: flush handlers
|
|
meta: flush_handlers
|
|
|
|
- name: ensure keepalived starts at boot
|
|
service:
|
|
name: keepalived
|
|
enabled: true
|
|
tags:
|
|
- service
|
|
|
|
- name: ensure keepalived is running
|
|
service:
|
|
name: keepalived
|
|
state: started
|
|
tags:
|
|
- service
|