Projet

Général

Profil

0001-clean-also-the-vitrualenv-57642.patch

Emmanuel Cazenave, 06 octobre 2021 14:55

Télécharger (4,47 ko)

Voir les différences:

Subject: [PATCH] clean: also the vitrualenv (#57642)

 clean.yml                  | 83 +++-----------------------------------
 roles/clean/tasks/main.yml | 77 +++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 78 deletions(-)
 create mode 100644 roles/clean/tasks/main.yml
clean.yml
1 1
---
2
- hosts: local
3
  tasks:
4
    - name: delete python venvs
5
      file:
6
        path: "{{venv_py3}}"
7
        state: absent
8

  
9
    - name: delete app /var/lib directory
10
      file:
11
        path: "/var/lib/{{item.value.project_name}}"
12
        state: absent
13
      with_dict: "{{apps}}"
14
      become: yes
15

  
16
    - name: delete server /var/log directory
17
      file:
18
        path: "/var/log/{{item.value.project_name}}-server"
19
        state: absent
20
      with_dict: "{{apps}}"
21
      become: yes
22

  
23
    - name: delete agent /var/log directory
24
      file:
25
        path: "/var/log/hobo-agent"
26
        state: absent
27
      become: yes
28

  
29
    - name: delete supervisor server conf 
30
      file:
31
        path: "/etc/supervisor/conf.d/{{item.value.project_name}}-server.conf"
32
        state: absent
33
      with_dict: "{{apps}}"
34
      become: yes
35
      
36
    - name: delete supervisor agent conf 
37
      file:
38
        path: "/etc/supervisor/conf.d/hobo-agent.conf"
39
        state: absent
40
      become: yes
41

  
42
    - name: reload supervisor
43
      shell: /etc/init.d/supervisor reload
44
      become: yes
45

  
46
    - name: delete nginx app server conf link
47
      file:
48
        path: "/etc/nginx/sites-enabled/{{item.value.project_name}}"
49
        state: absent
50
      with_dict: "{{apps}}"
51
      become: yes
52

  
53
    - name: delete nginx app server conf 
54
      file:
55
        path: "/etc/nginx/sites-available/{{item.value.project_name}}"
56
        state: absent
57
      with_dict: "{{apps}}"
58
      become: yes
59

  
60
    - name: reload nginx
61
      shell: /etc/init.d/nginx reload
62
      become: yes
63

  
64
    - name: delete /etc app directory
65
      file:
66
        path: "/etc/{{item.value.project_name}}"
67
        state: absent
68
      with_dict: "{{apps}}"
69
      become: yes
70
      
71
    - name: delete db
72
      postgresql_db:
73
        name: "{{item.value.db_name}}"
74
        state: absent
75
        port: "{{postgresql_port}}"
76
      with_dict: "{{apps}}"
77
      become: yes
78
      become_user: postgres
79

  
2
- name: delete publik installation
3
  hosts: local
4
  roles:
5
    - facts
6
    - clean
roles/clean/tasks/main.yml
1

  
2
- name: delete python venvs
3
  file:
4
    path: "{{venv_py3}}"
5
    state: absent
6

  
7
- name: delete app /var/lib directory
8
  file:
9
    path: "/var/lib/{{item.value.project_name}}"
10
    state: absent
11
  with_dict: "{{apps}}"
12
  become: yes
13

  
14
- name: delete server /var/log directory
15
  file:
16
    path: "/var/log/{{item.value.project_name}}-server"
17
    state: absent
18
  with_dict: "{{apps}}"
19
  become: yes
20

  
21
- name: delete agent /var/log directory
22
  file:
23
    path: "/var/log/hobo-agent"
24
    state: absent
25
  become: yes
26

  
27
- name: delete supervisor server conf 
28
  file:
29
    path: "/etc/supervisor/conf.d/{{item.value.project_name}}-server.conf"
30
    state: absent
31
  with_dict: "{{apps}}"
32
  become: yes
33
  
34
- name: delete supervisor agent conf 
35
  file:
36
    path: "/etc/supervisor/conf.d/hobo-agent.conf"
37
    state: absent
38
  become: yes
39

  
40
- name: reload supervisor
41
  shell: /etc/init.d/supervisor reload
42
  become: yes
43

  
44
- name: delete nginx app server conf link
45
  file:
46
    path: "/etc/nginx/sites-enabled/{{item.value.project_name}}"
47
    state: absent
48
  with_dict: "{{apps}}"
49
  become: yes
50

  
51
- name: delete nginx app server conf 
52
  file:
53
    path: "/etc/nginx/sites-available/{{item.value.project_name}}"
54
    state: absent
55
  with_dict: "{{apps}}"
56
  become: yes
57

  
58
- name: reload nginx
59
  shell: /etc/init.d/nginx reload
60
  become: yes
61

  
62
- name: delete /etc app directory
63
  file:
64
    path: "/etc/{{item.value.project_name}}"
65
    state: absent
66
  with_dict: "{{apps}}"
67
  become: yes
68
  
69
- name: delete db
70
  postgresql_db:
71
    name: "{{item.value.db_name}}"
72
    state: absent
73
    port: "{{postgresql_port}}"
74
  with_dict: "{{apps}}"
75
  become: yes
76
  become_user: postgres
77

  
0
-