From a6315758c7c3ca3e13ead140c2a8af05ea1ccd24 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Sat, 27 Mar 2021 20:47:03 +0800 Subject: [PATCH] fix: installation of ex-lb --- ezctl | 45 +++++++++++++++++++------------------ playbooks/10.ex-lb.yml | 3 +++ roles/ex-lb/clean-ex-lb.yml | 32 ++++++++------------------ 3 files changed, 35 insertions(+), 45 deletions(-) create mode 100644 playbooks/10.ex-lb.yml diff --git a/ezctl b/ezctl index 049e7cb..66372af 100755 --- a/ezctl +++ b/ezctl @@ -110,18 +110,19 @@ function usage-setup(){ echo -e "\033[33mUsage:\033[0m ezctl setup " cat < 0" + - name: get service info + shell: 'systemctl list-units --type=service |grep -E "haproxy|keepalived|ssh"' + register: service_info - - name: stop keepalived service - service: name=keepalived state=stopped enabled=no + - name: remove service haproxy + service: name=haproxy state=stopped enabled=no + when: '"haproxy" in service_info.stdout' ignore_errors: true - - name: stop haproxy service - service: name=haproxy state=stopped enabled=no + - name: remove service keepalived + service: name=keepalived state=stopped enabled=no + when: '"keepalived" in service_info.stdout' ignore_errors: true - name: remove files and dirs @@ -26,11 +20,3 @@ with_items: - "/etc/haproxy" - "/etc/keepalived" - - - name: clean 'ENV PATH' - lineinfile: - dest: ~/.bashrc - state: absent - regexp: '{{ item }}' - with_items: - - 'kubeasz'