From 5e8e5c7374a8954a07c628cfb82b3efa04e0acb1 Mon Sep 17 00:00:00 2001 From: wilanhuang Date: Thu, 25 Apr 2019 15:19:53 +0800 Subject: [PATCH] Add unsafe_cleanup.yml for DM --- 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