openstack-ansible-ops/leap-upgrades/upgrade-utilities/haproxy-cleanup.yml
Jean-Philippe Evrard 7547fa4b8f Cleanup HAProxy before re-deploying haproxy
HAProxy should not have an init that loads conf.d files, like it
was done on K, and removed in N, during the haproxy installation.
Else the installation of the package will fail, because it will
load the conf.d files.

Change-Id: I345089cc3493b90c1c4fbd2d47c51f83c65c94f4
2017-08-11 15:57:48 +01:00

27 lines
712 B
YAML

---
- hosts: haproxy
gather_facts: no
tasks:
- name: Backup haproxy init file
fetch:
src: /etc/init.d/haproxy
dest: "/opt/leap42/haproxy-kilo-{{ ansible_date_time.epoch }}.init"
- name: Removing haproxy init
file:
path: /etc/init.d/haproxy
state: absent
- name: Override haproxy init with known one
unarchive:
src: haproxy-cleanup.init
dest: /etc/init.d/
- name: Ensure permissions for new haproxy init
file:
path: /etc/init.d/haproxy
mode: 0755
owner: root
group: root
- name: Cleanup haproxy configuration folder
file:
path: /etc/haproxy/conf.d/
state: absent