Skip to content

Instantly share code, notes, and snippets.

@darron
Created May 26, 2015 19:09
Show Gist options
  • Save darron/1592debd77598dd7041e to your computer and use it in GitHub Desktop.
Save darron/1592debd77598dd7041e to your computer and use it in GitHub Desktop.
Running under Consul Template 0.9.0
darron@doctohost01:~$ cat config.cfg
consul = "127.0.0.1:8500"
retry = "10s"
max_stale = "10m"
log_level = "debug"
wait = "30s"
syslog {
enabled = true
facility = "LOCAL5"
}
template {
source = "/home/darron/template.ctmpl"
destination = "/home/darron/rendered.txt"
command = "logger -t consul consultemplate: I ran again"
}
darron@doctohost01:~$ consul-template -version
consul-template v0.9.0
darron@doctohost01:~$ consul-template -config config.cfg -log-level=debug
2015/05/26 15:06:31 [INFO] (runner) creating new runner (dry: false, once: false)
2015/05/26 15:06:31 [DEBUG] merging with config at config.cfg
2015/05/26 15:06:31 [DEBUG] runner: final config (tokens suppressed):
{
"path": "",
"consul": "127.0.0.1:8500",
"vault": {
"address": "",
"ssl": {
"enabled": true,
"verify": true,
"cert": "",
"ca_cert": ""
}
},
"auth": {
"enabled": false,
"username": "",
"password": ""
},
"ssl": {
"enabled": false,
"verify": true,
"cert": "",
"ca_cert": ""
},
"syslog": {
"enabled": false,
"facility": "LOCAL0"
},
"max_stale": 600000000000,
"templates": [
{
"source": "/home/darron/template.ctmpl",
"destination": "/home/darron/rendered.txt",
"command": "logger -t consul consultemplate: I ran again"
}
],
"retry": 5000000000,
"wait": {
"min": 0,
"max": 0
},
"log_level": "debug"
}
2015/05/26 15:06:31 [INFO] (runner) creating consul/api client
2015/05/26 15:06:31 [DEBUG] (runner) setting consul address to 127.0.0.1:8500
2015/05/26 15:06:31 [INFO] (runner) creating vault/api client
2015/05/26 15:06:31 [DEBUG] (runner) enabling vault SSL
2015/05/26 15:06:31 [INFO] (runner) creating Watcher
2015/05/26 15:06:31 [INFO] (runner) starting
2015/05/26 15:06:31 [DEBUG] (runner) running initial templates
2015/05/26 15:06:31 [INFO] (runner) running
2015/05/26 15:06:31 [DEBUG] (runner) checking template /home/darron/template.ctmpl
2015/05/26 15:06:31 [INFO] (runner) was not watching 1 dependencies
2015/05/26 15:06:31 [INFO] (watcher) adding "storeKeyPrefix(octohost)"
2015/05/26 15:06:31 [DEBUG] (watcher) "storeKeyPrefix(octohost)" starting
2015/05/26 15:06:31 [INFO] (runner) diffing and updating dependencies
2015/05/26 15:06:31 [INFO] (runner) watching 1 dependencies
2015/05/26 15:06:31 [DEBUG] (view) "storeKeyPrefix(octohost)" starting fetch
2015/05/26 15:06:31 [DEBUG] ("storeKeyPrefix(octohost)") querying Consul with &{Datacenter: AllowStale:true RequireConsistent:false WaitIndex:0 WaitTime:1m0s Token:}
2015/05/26 15:06:31 [DEBUG] ("storeKeyPrefix(octohost)") Consul returned 30 key pairs
2015/05/26 15:06:31 [INFO] (view) "storeKeyPrefix(octohost)" received data from consul
2015/05/26 15:06:31 [DEBUG] (runner) receiving dependency "storeKeyPrefix(octohost)"
2015/05/26 15:06:31 [INFO] (runner) running
2015/05/26 15:06:31 [DEBUG] (runner) checking template /home/darron/template.ctmpl
2015/05/26 15:06:31 [DEBUG] (view) "storeKeyPrefix(octohost)" starting fetch
2015/05/26 15:06:31 [DEBUG] ("storeKeyPrefix(octohost)") querying Consul with &{Datacenter: AllowStale:true RequireConsistent:false WaitIndex:6541 WaitTime:1m0s Token:}
2015/05/26 15:06:31 [DEBUG] (runner) checking ctemplate &{Source:/home/darron/template.ctmpl Destination:/home/darron/rendered.txt Command:logger -t consul consultemplate: I ran again}
2015/05/26 15:06:31 [DEBUG] (runner) wouldRender: true, didRender: true
2015/05/26 15:06:31 [DEBUG] (runner) appending command: logger -t consul consultemplate: I ran again
2015/05/26 15:06:31 [INFO] (runner) diffing and updating dependencies
2015/05/26 15:06:31 [DEBUG] (runner) "storeKeyPrefix(octohost)" is still needed
2015/05/26 15:06:31 [DEBUG] (runner) running command: `logger -t consul consultemplate: I ran again`
2015/05/26 15:06:31 [INFO] (runner) watching 1 dependencies
2015/05/26 15:07:28 [DEBUG] ("storeKeyPrefix(octohost)") Consul returned 31 key pairs
2015/05/26 15:07:28 [INFO] (view) "storeKeyPrefix(octohost)" received data from consul
2015/05/26 15:07:28 [DEBUG] (runner) receiving dependency "storeKeyPrefix(octohost)"
2015/05/26 15:07:28 [INFO] (runner) running
2015/05/26 15:07:28 [DEBUG] (runner) checking template /home/darron/template.ctmpl
2015/05/26 15:07:28 [DEBUG] (view) "storeKeyPrefix(octohost)" starting fetch
2015/05/26 15:07:28 [DEBUG] ("storeKeyPrefix(octohost)") querying Consul with &{Datacenter: AllowStale:true RequireConsistent:false WaitIndex:24934 WaitTime:1m0s Token:}
2015/05/26 15:07:28 [DEBUG] (runner) checking ctemplate &{Source:/home/darron/template.ctmpl Destination:/home/darron/rendered.txt Command:logger -t consul consultemplate: I ran again}
2015/05/26 15:07:28 [DEBUG] (runner) wouldRender: true, didRender: true
2015/05/26 15:07:28 [DEBUG] (runner) appending command: logger -t consul consultemplate: I ran again
2015/05/26 15:07:28 [INFO] (runner) diffing and updating dependencies
2015/05/26 15:07:28 [DEBUG] (runner) "storeKeyPrefix(octohost)" is still needed
2015/05/26 15:07:28 [DEBUG] (runner) running command: `logger -t consul consultemplate: I ran again`
2015/05/26 15:07:28 [INFO] (runner) watching 1 dependencies
2015/05/26 15:07:33 [DEBUG] ("storeKeyPrefix(octohost)") Consul returned 32 key pairs
2015/05/26 15:07:33 [INFO] (view) "storeKeyPrefix(octohost)" received data from consul
2015/05/26 15:07:33 [DEBUG] (runner) receiving dependency "storeKeyPrefix(octohost)"
2015/05/26 15:07:33 [INFO] (runner) running
2015/05/26 15:07:33 [DEBUG] (runner) checking template /home/darron/template.ctmpl
2015/05/26 15:07:33 [DEBUG] (view) "storeKeyPrefix(octohost)" starting fetch
2015/05/26 15:07:33 [DEBUG] ("storeKeyPrefix(octohost)") querying Consul with &{Datacenter: AllowStale:true RequireConsistent:false WaitIndex:24935 WaitTime:1m0s Token:}
2015/05/26 15:07:33 [DEBUG] (runner) checking ctemplate &{Source:/home/darron/template.ctmpl Destination:/home/darron/rendered.txt Command:logger -t consul consultemplate: I ran again}
2015/05/26 15:07:33 [DEBUG] (runner) wouldRender: true, didRender: true
2015/05/26 15:07:33 [DEBUG] (runner) appending command: logger -t consul consultemplate: I ran again
2015/05/26 15:07:33 [INFO] (runner) diffing and updating dependencies
2015/05/26 15:07:33 [DEBUG] (runner) "storeKeyPrefix(octohost)" is still needed
2015/05/26 15:07:33 [DEBUG] (runner) running command: `logger -t consul consultemplate: I ran again`
2015/05/26 15:07:33 [INFO] (runner) watching 1 dependencies
2015/05/26 15:07:38 [DEBUG] ("storeKeyPrefix(octohost)") Consul returned 33 key pairs
2015/05/26 15:07:38 [INFO] (view) "storeKeyPrefix(octohost)" received data from consul
2015/05/26 15:07:38 [DEBUG] (runner) receiving dependency "storeKeyPrefix(octohost)"
2015/05/26 15:07:38 [INFO] (runner) running
2015/05/26 15:07:38 [DEBUG] (runner) checking template /home/darron/template.ctmpl
2015/05/26 15:07:38 [DEBUG] (view) "storeKeyPrefix(octohost)" starting fetch
2015/05/26 15:07:38 [DEBUG] ("storeKeyPrefix(octohost)") querying Consul with &{Datacenter: AllowStale:true RequireConsistent:false WaitIndex:24936 WaitTime:1m0s Token:}
2015/05/26 15:07:38 [DEBUG] (runner) checking ctemplate &{Source:/home/darron/template.ctmpl Destination:/home/darron/rendered.txt Command:logger -t consul consultemplate: I ran again}
2015/05/26 15:07:38 [DEBUG] (runner) wouldRender: true, didRender: true
2015/05/26 15:07:38 [DEBUG] (runner) appending command: logger -t consul consultemplate: I ran again
2015/05/26 15:07:38 [INFO] (runner) diffing and updating dependencies
2015/05/26 15:07:38 [DEBUG] (runner) "storeKeyPrefix(octohost)" is still needed
2015/05/26 15:07:38 [DEBUG] (runner) running command: `logger -t consul consultemplate: I ran again`
2015/05/26 15:07:38 [INFO] (runner) watching 1 dependencies
^CReceived interrupt, cleaning up...
2015/05/26 15:08:15 [INFO] (runner) stopping
2015/05/26 15:08:15 [INFO] (watcher) stopping all views
2015/05/26 15:08:15 [DEBUG] (watcher) stopping "storeKeyPrefix(octohost)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment