Skip to content

Commit

Permalink
upgrade/k8s/load_balancer: adding legacy haproxy removal
Browse files Browse the repository at this point in the history
  • Loading branch information
sk4zuzu committed Sep 10, 2020
1 parent 08e8032 commit ded665b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
service_facts:
no_log: true

- name: k8s/haproxy | Stop and disable legacy haproxy.service
systemd:
name: haproxy.service
state: stopped
enabled: false
- name: k8s/haproxy | Remove legacy haproxy
include_tasks:
file: "legacy-haproxy/{{ ansible_os_family }}/uninstall-haproxy.yml"
when:
# After this upgrade it is completely possible to have load_balancer component deployed on any k8s master/node
- ansible_facts.services["haproxy-k8s.services"] is undefined
- ansible_facts.services["haproxy-k8s.service"] is undefined
- ansible_facts.services["haproxy.service"] is defined
- ansible_facts.services["haproxy.service"].state == "running"

- name: k8s/haproxy | Install haproxy-k8s service (runc)
include_role:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: haproxy/uninstall | Uninstall haproxy package
apt:
name: haproxy
update_cache: true
state: absent
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: haproxy/uninstall | Uninstall haproxy family packages
yum:
name:
- rh-haproxy18
- rh-haproxy18-haproxy
- rh-haproxy18-haproxy-syspaths
- rh-haproxy18-runtime
update_cache: true
state: absent
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- name: load_balancer | Remove legacy haproxy
include_tasks:
file: "legacy-haproxy/{{ ansible_os_family }}/uninstall-haproxy.yml"

- name: load_balancer | Upgrade haproxy service (runc)
include_role:
name: haproxy
Expand Down

0 comments on commit ded665b

Please sign in to comment.