diff --git a/leap-upgrades/re-deploy.sh b/leap-upgrades/re-deploy.sh index 9f8fb3e1..742ea8e7 100755 --- a/leap-upgrades/re-deploy.sh +++ b/leap-upgrades/re-deploy.sh @@ -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") diff --git a/leap-upgrades/upgrade-utilities/haproxy-cleanup.init b/leap-upgrades/upgrade-utilities/haproxy-cleanup.init new file mode 100644 index 00000000..df9610fc Binary files /dev/null and b/leap-upgrades/upgrade-utilities/haproxy-cleanup.init differ diff --git a/leap-upgrades/upgrade-utilities/haproxy-cleanup.yml b/leap-upgrades/upgrade-utilities/haproxy-cleanup.yml new file mode 100644 index 00000000..2f5d6c10 --- /dev/null +++ b/leap-upgrades/upgrade-utilities/haproxy-cleanup.yml @@ -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