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
This commit is contained in:
Jean-Philippe Evrard 2017-08-11 09:40:05 +01:00
parent 64d7f6e62a
commit 7547fa4b8f
3 changed files with 27 additions and 0 deletions

View File

@ -57,6 +57,7 @@ RUN_TASKS+=("lxc-containers-create.yml")
# Setup Infrastructure
RUN_TASKS+=("unbound-install.yml")
RUN_TASKS+=("repo-install.yml")
RUN_TASKS+=("${UPGRADE_UTILS}/haproxy-cleanup.yml")
RUN_TASKS+=("haproxy-install.yml")
RUN_TASKS+=("memcached-install.yml")
RUN_TASKS+=("galera-install.yml")

Binary file not shown.

View File

@ -0,0 +1,26 @@
---
- 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