CausticLab / go-rancher-gen

:cow: Generate configuration files using templates and Rancher Metadata
MIT License
0 stars 2 forks source link

Notify container #1

Closed Munsio closed 7 years ago

Munsio commented 7 years ago

At first we have to decide if we want to notify the container via sighub or over the rancher-api. When we include the rancher-api we can send the notify/check cmds thats not possible with signals.

The config could look like this:

api-url: https://rancher-api
api-token: 0123456789

[[template]]
source = "/etc/rancher-gen/nginx.tmpl"
dest = "/etc/nginx/nginx.conf"
notify-label = "reload"
check-cmd = "/usr/sbin/nginx -t -c {{staging}}"
notify-cmd = "/usr/sbin/nginx -s reload"
Munsio commented 7 years ago

We could use both.

As a base to determine which container should be notified we can use the notify-label description.

if api-url and token are present we use the rancher-api for the notification

emcniece commented 7 years ago

This is now handled by rgon-exec - closing!

[[template]]
source = "/etc/rancher-gen/nginx.tmpl"
dest = "/etc/nginx/nginx.conf"
notify-label = "rgon-proxy:nginx"
notify-cmd = "rgon-exec -name={{Name}} -cmd=\"service nginx reload\""