forked from alinefr/monit-formula
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
# salt-call pillar.get monit
[snip]
"modules": {
"salt-minion": {
"process": {
"config": {
"start": "service salt-minion start",
"stop": "service salt-minion stop"
},
"with": {
"pidfile": "/var/run/salt-minion.pid"
},
"custom": {
"name": "salt-minion"
}
}
},
"nginx": {
"process": {
"config": {
"stop": "service nginx stop",
"start": "service nginx start",
"group": "www-data"
},
"if": {
"action": "restart",
"failed": "host 127.0.0.1 port 80 protocol http"
},
"with": {
"pidfile": "/var/run/nginx.pid"
},
"custom": {
"name": "nginx"
}
}
},
"varnish": {
"process": {
"config": {
"start": "service varnish start",
"stop": "service varnish stop"
},
"if": {
"action": "restart",
"failed": "host 127.0.0.1 port 6081 protocol http"
},
"with": {
"pidfile": "/var/run/varnish.pid"
},
"if2": {
"action": "restart",
"failed": "host 127.0.0.1 port 6082 protocol http"
},
"custom": {
"name": "varnish"
}
}
}
}
Gives the following config, the order is wrong
# cat conf.d/modules
# -*- coding: utf-8 -*-
# vim: ft=jinja
start program = "service salt-minion start"
stop program = "service salt-minion stop"
check process salt-minion with pidfile /var/run/salt-minion.pid
stop program = "service nginx stop"
start program = "service nginx start"
group www-data
if failed host 127.0.0.1 port 80 protocol http then restart
check process nginx with pidfile /var/run/nginx.pid
start program = "service varnish start"
stop program = "service varnish stop"
if failed host 127.0.0.1 port 6081 protocol http then restart
check process varnish with pidfile /var/run/varnish.pid
if failed host 127.0.0.1 port 6082 protocol http then restart
Metadata
Metadata
Assignees
Labels
No labels