Skip to content

Instantly share code, notes, and snippets.

@groob
Created August 9, 2014 23:49
Show Gist options
  • Save groob/d77a713a1bd1427f73bd to your computer and use it in GitHub Desktop.
Save groob/d77a713a1bd1427f73bd to your computer and use it in GitHub Desktop.
[Unit]
Description=Register for Munki service
BindsTo=munki@%i.service
After=munki@%i.service
[Service]
EnvironmentFile=/etc/environment
RemainAfterExit=yes
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/munki.whitbyschool.net/endpoints/munki-register@%i.service\" http://$COREOS_PUBLIC_IPV4:%i; \
/bin/etcdctl set \"/vulcand/hosts/munki.whitbyschool.net/locations/home/path\" '/.*'; \
/bin/etcdctl set \"/vulcand/hosts/munki/locations/home/path\" '/.*'; \
/bin/etcdctl set /vulcand/hosts/munki.whitbyschool.net/locations/home/upstream munki.whitbyschool.net; \
/bin/etcdctl set /vulcand/hosts/munki/locations/home/upstream munki.whitbyschool.net"
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/munki.whitbyschool.net/endpoints/munki-register@%i.service"
[X-Fleet]
X-ConditionMachineOf=munki@%i.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment