forked from easzlab/kubeasz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- hosts: ex_lb | ||
roles: | ||
- ex-lb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
- hosts: | ||
- ex_lb | ||
tasks: | ||
- block: | ||
- name: stop and disable chrony in Ubuntu | ||
service: name=chrony state=stopped enabled=no | ||
ignore_errors: true | ||
when: 'ansible_distribution in ["Ubuntu","Debian"]' | ||
|
||
- name: stop and disable chronyd in CentOS/RedHat | ||
service: name=chronyd state=stopped enabled=no | ||
ignore_errors: true | ||
when: 'ansible_distribution in ["CentOS","RedHat","Amazon","Aliyun"]' | ||
when: "groups['chrony']|length > 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 | ||
file: name={{ item }} state=absent | ||
with_items: | ||
- "/etc/haproxy" | ||
- "/etc/keepalived" | ||
|
||
- name: clean 'ENV PATH' | ||
lineinfile: | ||
dest: ~/.bashrc | ||
state: absent | ||
regexp: '{{ item }}' | ||
with_items: | ||
- 'kubeasz' |