Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
- name: log inventory role
import_role:
name: _app_log_inventory
vars:
log_type: "uninstall"
- name: uninstall ningx and logs
block:
- name: "disable site for {{ app_domain }}"
file:
state: absent
path: "/etc/nginx/sites-enabled/{{ app_instance_id }}.conf"
when: app_domain is defined and app_domain != ""
register: disable_site
- import_role:
name: _app_monit
when: monit_request is defined and monit_request != ''
- name: reload monit
service: name=monit state=reloaded
when: disable_site.changed
- name: "remove nginx configuration for {{ app_instance_id }}"
file:
state: absent
path: "/etc/nginx/sites-available/{{ app_instance_id }}.conf"
- name: reload nginx
service: name=nginx state=reloaded
when: disable_site.changed
- import_role:
name: _letsencrypt_certificate
- import_role:
name: _app_logrotate
- name: "umount {{ app_instance_id }} logs"
shell: "umount {{ app_instance_root }}/../logs/{{ app_instance_id }}"
failed_when: False
changed_when: false
when: app_user is defined
- name: "Remove mount line in fstab for {{ app_user }}"
lineinfile:
path: "/etc/fstab"
regexp: "^{{ www_log }}/{{ app_instance_id }}"
state: absent
when: app_user is defined
- name: "remove mount point for {{ app_instance_id }} logs "
file:
state: absent
path: "{{ app_instance_root }}/../logs/{{ app_instance_id }}"
when: app_user is defined
when: app_domain != ""
- import_tasks: uninstall_sonarqube.yml
- name: "remove {{ app_instance_root }}"
file:
state: absent
path: "{{ app_instance_root }}"
- name: remove user {{ app_user }}
import_role:
name: _user
vars:
user_name: "{{ app_user }}"
user_password: "{{ app_user_password }}"
user_to_remove: "{{ app_user }}"
when: app_user is defined