Skip to content

Instantly share code, notes, and snippets.

@jsierles
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/d426a9c5a2f21fc78745 to your computer and use it in GitHub Desktop.
Save jsierles/d426a9c5a2f21fc78745 to your computer and use it in GitHub Desktop.
#!/bin/bash
{{range $key, $value := .}}
{{ with $address := index $value.Addresses 0 }}
# {{ $value.Name }}
curl -L http://127.0.0.1:4001/v2/keys/backends/{{ $value.Image.Repository}}/{{printf "%.*s" 12 $value.ID}} -XPUT -d value="{{ $address.IP }}:{{ $address.Port }}" -d ttl=15
{{ end }}
{{end}}
2014/06/03 10:36:55 template error: template: etcd.tmpl:4:20: executing "etcd.tmpl" at <index $value.Address...>: error calling index: index out of range: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment