37 lines
754 B
YAML
37 lines
754 B
YAML
---
|
|
|
|
- block:
|
|
- name: Run "apt update / upgrade"
|
|
apt:
|
|
upgrade: yes
|
|
update_cache: yes
|
|
retries: 10
|
|
delay: 30
|
|
|
|
- name: Install haproxy keepalived etc
|
|
apt:
|
|
state: latest
|
|
pkg: "{{ pkg_list }}"
|
|
|
|
- name: Create /etc/haproxy/haproxy.cfg
|
|
template:
|
|
src: haproxy.cfg.j2
|
|
dest: "/etc/haproxy/haproxy.cfg"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Restart_haproxy
|
|
|
|
- name: Create /etc/keepalived/keepalived.conf
|
|
template:
|
|
src: keepalived.conf.j2
|
|
dest: "/etc/keepalived/keepalived.conf"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Restart_keepalived
|
|
when: ansible_distribution == "Debian" and ansible_distribution_major_version == "12"
|
|
|
|
|
|
|