2019-02-07 15:10:49 +08:00
|
|
|
- hosts:
|
|
|
|
- ex-lb
|
|
|
|
tasks:
|
2019-05-30 21:37:01 +08:00
|
|
|
- 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
|
2020-12-30 11:25:54 +08:00
|
|
|
when: 'ansible_distribution in ["CentOS","RedHat","Amazon","Aliyun"]'
|
2019-05-30 21:37:01 +08:00
|
|
|
when: "groups['chrony']|length > 0"
|
2019-02-07 15:10:49 +08:00
|
|
|
|
|
|
|
- name: stop keepalived service
|
|
|
|
service: name=keepalived state=stopped enabled=no
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: stop haproxy service
|
|
|
|
service: name=haproxy state=stopped enabled=no
|
|
|
|
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'
|