-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmain.yml
More file actions
57 lines (48 loc) · 1.14 KB
/
main.yml
File metadata and controls
57 lines (48 loc) · 1.14 KB
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
---
- name: Remove the httpd configuration
file:
path: /etc/httpd/conf.d/{{ item | replace('-','_') }}.conf
state: absent
notify:
- restart httpd
with_items:
- "{{ java_apps_to_remove }}"
- name: Disable and stop the app
service:
name: "{{ item }}"
enabled: no
state: stopped
with_items:
- "{{ java_apps_to_remove }}"
- name: Remove the app dir and its contents
file:
path: /opt/{{ item }}/
state: absent
with_items:
- "{{ java_apps_to_remove }}"
- name: Remove the www dir
file:
path: /var/www/{{ item }}/
state: absent
with_items:
- "{{ java_apps_to_remove }}"
- name: Remove the logs
file:
path: /var/log/{{ item }}/
state: absent
with_items:
- "{{ java_apps_to_remove }}"
- name: Force a daemon reload before removing the systemd file
systemd:
daemon_reload: yes
- name: Remove the systemd service file
file:
path: "/etc/systemd/system/{{ item }}.service"
state: absent
notify:
- daemon_reload
with_items:
- "{{ java_apps_to_remove }}"
register: systemd_removed
- name: Reset failed services
command: "systemctl reset-failed"