kubeasz/roles/ex-lb/clean-ex-lb.yml

37 lines
964 B
YAML

- hosts:
- ex-lb
tasks:
- name: stop and disable chrony in Ubuntu
service: name=chrony state=stopped enabled=no
ignore_errors: true
tags: rm_ntp
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian"
- name: stop and disable chronyd in CentOS/RedHat
service: name=chronyd state=stopped enabled=no
ignore_errors: true
tags: rm_ntp
when: ansible_distribution == "CentOS" or ansible_distribution == "RedHat"
- 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'