publik-devinst/clean.yml

76 lines
1.8 KiB
YAML

---
- hosts: local
tasks:
- name: delete venv
file:
path: "{{venv}}"
state: absent
- name: delete app /var/lib directory
file:
path: "/var/lib/{{item.value.project_name}}"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete server /var/log directory
file:
path: "/var/log/{{item.value.project_name}}-server"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete agent /var/log directory
file:
path: "/var/log/{{item.value.project_name}}-agent"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete supervisor server conf
file:
path: "/etc/supervisor/conf.d/{{item.value.project_name}}-server.conf"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete supervisor agent conf
file:
path: "/etc/supervisor/conf.d/{{item.value.project_name}}-agent.conf"
state: absent
with_dict: "{{apps}}"
become: yes
- name: reload supervisor
systemd:
name: supervisor
state: reloaded
become: yes
- name: delete nginx app server link conf
file:
path: "/etc/nginx/sites-enabled/{{item.value.project_name}}"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete nginx app server conf
file:
path: "/etc/nginx/sites-available/{{item.value.project_name}}"
state: absent
with_dict: "{{apps}}"
become: yes
- name: reload nginx
systemd:
name: nginx
state: reloaded
become: yes
- name: delete db
postgresql_db:
name: "{{item.value.db_name}}"
state: absent
with_dict: "{{apps}}"