Added code
This commit is contained in:
36
ansible/roles/k8s-api-ha/tasks/main.yml
Normal file
36
ansible/roles/k8s-api-ha/tasks/main.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
|
||||
- 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"
|
||||
|
||||
|
||||
|
4
ansible/roles/k8s-api-ha/tasks/ping.yml
Normal file
4
ansible/roles/k8s-api-ha/tasks/ping.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
- name: ping
|
||||
ping:
|
Reference in New Issue
Block a user