clean: also the vitrualenv (#57642)

This commit is contained in:
Emmanuel Cazenave 2021-10-06 14:55:04 +02:00
parent 97511da88a
commit 5859447d04
2 changed files with 82 additions and 78 deletions

View File

@ -1,79 +1,6 @@
---
- hosts: local
tasks:
- name: delete python venvs
file:
path: "{{venv_py3}}"
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/hobo-agent"
state: absent
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/hobo-agent.conf"
state: absent
become: yes
- name: reload supervisor
shell: /etc/init.d/supervisor reload
become: yes
- name: delete nginx app server conf link
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
shell: /etc/init.d/nginx reload
become: yes
- name: delete /etc app directory
file:
path: "/etc/{{item.value.project_name}}"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete db
postgresql_db:
name: "{{item.value.db_name}}"
state: absent
port: "{{postgresql_port}}"
with_dict: "{{apps}}"
become: yes
become_user: postgres
- name: delete publik installation
hosts: local
roles:
- facts
- clean

View File

@ -0,0 +1,77 @@
- name: delete python venvs
file:
path: "{{venv_py3}}"
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/hobo-agent"
state: absent
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/hobo-agent.conf"
state: absent
become: yes
- name: reload supervisor
shell: /etc/init.d/supervisor reload
become: yes
- name: delete nginx app server conf link
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
shell: /etc/init.d/nginx reload
become: yes
- name: delete /etc app directory
file:
path: "/etc/{{item.value.project_name}}"
state: absent
with_dict: "{{apps}}"
become: yes
- name: delete db
postgresql_db:
name: "{{item.value.db_name}}"
state: absent
port: "{{postgresql_port}}"
with_dict: "{{apps}}"
become: yes
become_user: postgres