From 5508d976ddfa33c2ff78c015fb3a8a1613df38b1 Mon Sep 17 00:00:00 2001 From: wilanhuang <923020286@qq.com> Date: Sun, 28 Apr 2019 16:03:29 +0800 Subject: [PATCH] Add unsafe_cleanup.yml for dm ansible (#128) --- dm/dm-ansible/unsafe_cleanup.yml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 dm/dm-ansible/unsafe_cleanup.yml diff --git a/dm/dm-ansible/unsafe_cleanup.yml b/dm/dm-ansible/unsafe_cleanup.yml new file mode 100644 index 0000000000..f68fe48b93 --- /dev/null +++ b/dm/dm-ansible/unsafe_cleanup.yml @@ -0,0 +1,58 @@ +--- + +# The Playbook of DM + +- import_playbook: stop.yml + + +- hosts: alertmanager_servers + tasks: + - name: clean systemd config + file: path="/etc/systemd/system/{{ item }}" state=absent + become: true + with_items: + - alertmanager-{{ alertmanager_port }}.service + + +- hosts: prometheus_servers + tasks: + - name: clean systemd config + file: path="/etc/systemd/system/{{ item }}" state=absent + become: true + with_items: + - prometheus-{{ prometheus_port }}.service + + +- hosts: grafana_servers + tasks: + - name: clean systemd config + file: path="/etc/systemd/system/{{ item }}" state=absent + become: true + with_items: + - grafana-{{ grafana_port }}.service + +- hosts: dm_worker_servers + tasks: + - name: clean systemd config + file: path="/etc/systemd/system/{{ item }}" state=absent + become: true + with_items: + - dm-worker-{{ dm_worker_port }}.service + + +- hosts: dm_master_servers + tasks: + - name: clean systemd config + file: path="/etc/systemd/system/{{ item }}" state=absent + become: true + with_items: + - dm-master-{{ dm_master_port }}.service + + +- hosts: all + tasks: + - name: using rm command to clean up deploy_dir + shell: "rm -rf {{ deploy_dir }}/*" + + - name: cleaning up deploy dir + file: path={{ deploy_dir }} state=absent