-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-running-process-centos.yaml
30 lines (30 loc) · 1.25 KB
/
check-running-process-centos.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
# An OS policy assignment that ensures Apache web server is running on Linux OSes.
# The assignment is applied only to those VMs that have the label `type:webserver` assigned to them.
osPolicies:
- id: apache-always-up-policy
mode: ENFORCEMENT
resourceGroups:
- resources:
id: ensure-apache-is-up
exec:
validate:
interpreter: SHELL
# If Apache web server is already running, return an exit code 100 to indicate
# that exec resource is already in desired state. In this scenario,
# the `enforce` step will not be run.
# Otherwise return an exit code of 101 to indicate that exec resource is not in
# desired state. In this scenario, the `enforce` step will be run.
script: if systemctl is-active --quiet httpd; then exit 100; else exit 101; fi
enforce:
interpreter: SHELL
# Start Apache web server and return an exit code of 100 to indicate that the
# resource is now in its desired state.
script: systemctl start httpd && exit 100
instanceFilter:
inclusionLabels:
- labels:
type: webserver
rollout:
disruptionBudget:
fixed: 10
minWaitDuration: 300s