containerpilot.json5 2.03 KB
Newer Older
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
{
    consul: {
        address: "{{ .CONSUL_HOST }}"
    },
    jobs: [
        {
            name: "update-service-conf",
            exec: ["/usr/local/bin/update-service-conf"]
        },
        {
            name: "controller",
            exec: ["python3", "-u", "/srv/bin/controller"],
            health: {
                exec: "pkill -0 -f /srv/bin/controller",
                interval: 10,
                ttl: 20
            },
            when: {
                source: "update-service-conf",
                once: "exitSuccess"
            },
            restarts: "unlimited",
            port: -1
        },
        {
            name: "oncrossbarchange-update-service-conf",
            exec: ["/usr/local/bin/update-service-conf", "reload"],
            when: {
                source: "watch.crossbar",
                each: "changed"
            }
        },
        {
            name: "wait-4-db",
            exec: ["python3", "-u", "/srv/bin/persistent-database"],
            when: {
               source: "watch.crossbar",
               once: "healthy",
           },
        },
        {
            name: "salt-master",
Matthieu Lamalle's avatar
Acl  
Matthieu Lamalle committed
43
            exec: ["salt-master", "-l", '{{ .SALTMASTER_LOG_LEVEL | default "info" }}'],
44 45 46 47 48 49 50 51 52 53 54 55 56 57
            health: {
                exec: "/bin/nc -z 127.0.0.1 30009",
                interval: 10,
                ttl: 20
            },
            when: {
                source: "wait-4-db",
                once: "exitSuccess",
            },
            port: 30009,
            restarts: "unlimited"
        },
        {
          name: "salt-api",
Matthieu Lamalle's avatar
Acl  
Matthieu Lamalle committed
58
          exec: ["salt-api", "-l", '{{ .SALT_API_LOG_LEVEL | default "info" }}'],
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
          health: {
            exec: "/bin/nc -z 127.0.0.1 8000",
            interval: 10,
            ttl: 20
          },
          port: 8000,
          when: {
                  source: "salt-master",
            once: "healthy"
          },
          restarts: "unlimited"
        }
    ],
    watches: [
        {
            name: "crossbar",
            interval: 5
        }
    ]
}