-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.yml
More file actions
38 lines (33 loc) · 1.1 KB
/
task.yml
File metadata and controls
38 lines (33 loc) · 1.1 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
environments:
HOME: /root
PATH: $PATH:/opt/chefdk/embedded/bin:/opt/chef/embedded/bin:/usr/bin:/usr/local/bin
ROLE: '{{config.role}}'
CONSUL_SECRET_KEY: '{{config.token}}'
default:
timeout: 1800
events:
configure:
description: Execute DR configure
priority: 99
task: configure
spec:
description: Execute DR spec
task: spec
tasks:
configure:
description: Zabbix disaster recovery
operations:
- execute:
script: |
curl -skL https://bootstrap.pypa.io/get-pip.py | python
pip install wheel --upgrade
pip install setuptools --upgrade
pip install --use-wheel py-zabbix --upgrade
consul lock -token $CONSUL_SECRET_KEY -verbose service/monitoring/configure/lock "python ./registory/zabbix_registory.py" | tee $log_path
! grep "Error running handler: exit status" $log_path
spec:
description: Zabbix disaster recovery spec
operations:
- execute:
script: |
consul lock -token $CONSUL_SECRET_KEY -verbose service/monitoring/spec/lock "python ./spec/zabbix_spec.py"