{
consul: "localhost:8500",
logging: {
level: "INFO",
format: "default",
output: "stdout"
},
jobs: [
{
name: "app",
exec: "/bin/app",
restarts: "unlimited",
port: 80,
when: {
// we want to start this job when the "setup" job has exited
// with success but give up after 60 sec
source: "setup",
once: "exitSuccess",
timeout: "60s"
},
health: {
exec: "/usr/bin/curl --fail -s -o /dev/null http://localhost/app",
interval: 5,
tll: 10,
timeout: "5s",
},
tags: [
"app",
"prod"
],
interfaces: [
"eth0",
"eth1[1]",
"192.168.0.0/16",
"2001:db8::/64",
"eth2:inet",
"eth2:inet6",
"inet",
"inet6",
"static:192.168.1.100", // a trailing comma isn't an error!
]
},
{
// we can create a chain of "setup" events by having
// jobs wait for other jobs to become healthy
name: "setup",
when: {
source: "consul-agent",
once: "healthy"
},
exec: "/usr/local/bin/preStart-script.sh",
restart: "never"
},
{
name: "preStop",
when: {
source: "app",
once: "stopping"
},
exec: "/usr/local/bin/preStop-script.sh",
restart: "never",
},
{
name: "postStop",
when: {
source: