forked from cyverse-archive/de-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-systemd-services-running.yaml
132 lines (115 loc) · 4.05 KB
/
verify-systemd-services-running.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
# Verifies that all services are running in the appropriate hosts
#
# ansible-playbook -i inventories/.. -K verify-systemd-services-running.yaml
#
### Only verify (services,ui,elk,docker-ready) hosts
# ansible-playbook -i inventories/.. -K --tags "services" verify-systemd-services-running.yaml
# ansible-playbook -i inventories/.. -K --tags "ui" verify-systemd-services-running.yaml
# ansible-playbook -i inventories/.. -K --tags "elk" verify-systemd-services-running.yaml
# ansible-playbook -i inventories/.. -K --tags "docker-ready" verify-systemd-services-running.yaml
- name: Verify services running on service hosts
hosts: services
sudo: yes
tasks:
- name: services are running
shell: systemctl is-active {{item.service_name}}
register: verify_services_running
ignore_errors: yes
with_items:
- "{{data_info}}"
- "{{anon_files}}"
- "{{condor_log_monitor}}"
- "{{clockwork}}"
- "{{donkey}}"
- "{{iplant_email}}"
- "{{iplant_groups}}"
- "{{exim}}"
- "{{jexevents}}"
- "{{kifshare}}"
- "{{metadactyl}}"
- "{{metadata}}"
- "{{notificationagent}}"
- "{{saved_searches}}"
- "{{tree_urls}}"
- "{{user_preferences}}"
- "{{user_sessions}}"
- "{{jex}}"
tags:
- services
- fail: msg="{{item.item.service_name}} does not appear to be running"
when: item.rc != 0
with_items: "{{verify_services_running.results}}"
tags:
- services
- name: non-parasitic services are running
shell: systemctl is-active {{item.service_name}}
register: verify_non_parasitic_services_running
ignore_errors: yes
when: not parasitic
with_items:
- "{{dewey}}"
- "{{infosquito}}"
- "{{info_typer}}"
- "{{monkey}}"
tags:
- services
- fail: msg="{{item.item.service_name}} does not appear to be running"
when: not parasitic and item.rc != 0
with_items: "{{verify_non_parasitic_services_running.results}}"
tags:
- services
- name: Verify services running on ui hosts
hosts: ui
sudo: yes
tasks:
- name: services are running
shell: systemctl is-active {{item.service_name}}
register: verify_services_running
ignore_errors: yes
with_items:
- "{{de}}"
- "{{de.http_server}}"
tags:
- ui
- fail: msg="{{item.item.service_name}} does not appear to be running"
when: item.rc != 0
with_items: "{{verify_services_running.results}}"
tags:
- ui
- name: Verify services running on elk hosts
hosts: elk
sudo: yes
tasks:
- name: services are running
shell: systemctl is-active {{item.service_name}}
register: verify_services_running
ignore_errors: yes
with_items:
- "{{elk.elasticsearch}}"
- "{{elk.kibana}}"
- "{{elk.logstash}}"
tags:
- elk
- fail: msg="{{item.item.service_name}} does not appear to be running"
when: item.rc != 0
with_items: "{{verify_services_running.results}}"
tags:
- elk
- name: Verify services running on docker-ready hosts
hosts: docker-ready
sudo: yes
tasks:
- name: services are running
shell: systemctl is-active {{item.service_name}}
register: verify_services_running
ignore_errors: yes
with_items:
- "{{logstash_forwarder}}"
tags:
- docker_ready
- fail: msg="{{item.item.service_name}} does not appear to be running"
when: item.rc != 0
with_items: "{{verify_services_running.results}}"
tags:
- docker_ready