Skip to content

Commit

Permalink
Add unsafe_cleanup.yml for dm ansible (pingcap#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilanhuang authored and csuzhangxc committed Apr 28, 2019
1 parent d2fd2c2 commit 5508d97
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions dm/dm-ansible/unsafe_cleanup.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5508d97

Please sign in to comment.