Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Add unsafe_cleanup.yml for dm ansible #128

Merged
merged 1 commit into from
Apr 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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