{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/339","labels_url":"https://api.github.com/repos/hashicorp/consul-template/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/339/comments","events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/339/events","html_url":"https://github.com/hashicorp/consul-template/issues/339","id":95513410,"number":339,"title":"The -once switch for consul-template","user":{"login":"johnr-spindance","id":7714111,"avatar_url":"https://avatars.githubusercontent.com/u/7714111?v=3","gravatar_id":"","url":"https://api.github.com/users/johnr-spindance","html_url":"https://github.com/johnr-spindance","followers_url":"https://api.github.com/users/johnr-spindance/followers","following_url":"https://api.github.com/users/johnr-spindance/following{/other_user}","gists_url":"https://api.github.com/users/johnr-spindance/gists{/gist_id}","starred_url":"https://api.github.com/users/johnr-spindance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnr-spindance/subscriptions","organizations_url":"https://api.github.com/users/johnr-spindance/orgs","repos_url":"https://api.github.com/users/johnr-spindance/repos","events_url":"https://api.github.com/users/johnr-spindance/events{/privacy}","received_events_url":"https://api.github.com/users/johnr-spindance/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/consul-template/labels/waiting-reply","name":"waiting-reply","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-16T19:52:26Z","updated_at":"2015-07-16T20:29:06Z","closed_at":"2015-07-16T20:26:06Z","body":"Hello,\r\n\r\nI have a customer who is using consul-template version 0.6.5 and have been asked to remove the service mode and provide them scripts that will invoke consul-template with the -once switch. I did encounter the issue where if consul-template didn't need to modify the destination file because no change applied than it would not exit. \r\n\r\nSo I decided to update them to version 0.10.0 (latest release). Unfortunately, I now have it where consul-template will execute the command and return with an exit status of 0. But nothing is updated and the haproxy service in my command is not restarted.\r\n\r\n```\r\nubuntu@ubuntu:~$ sudo consul-template -template \"/etc/haproxy/haproxy.cfg.ctmpl:/etc/haproxy/haproxy.cfg:service haproxy restart\" -once\r\nubuntu@ubuntu:~$ echo $?\r\n0\r\n```\r\n\r\nIn 0.6.5, I can run the same command but it only works if I remove the file its trying to update first.\r\n\r\nI also tried 0.7.0 and get similar results to version 0.10.0.\r\n\r\nIs there some issue with versions 0.7.0 through 0.10.0 that the -once parameter may not work as I expect? Is it possible its not communicating with consul (using version 0.4.1)? Any other ideas?\r\n\r\nAny help is greatly appreciated!"},"comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments/122080173","html_url":"https://github.com/hashicorp/consul-template/issues/339#issuecomment-122080173","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/339","id":122080173,"user":{"login":"johnr-spindance","id":7714111,"avatar_url":"https://avatars.githubusercontent.com/u/7714111?v=3","gravatar_id":"","url":"https://api.github.com/users/johnr-spindance","html_url":"https://github.com/johnr-spindance","followers_url":"https://api.github.com/users/johnr-spindance/followers","following_url":"https://api.github.com/users/johnr-spindance/following{/other_user}","gists_url":"https://api.github.com/users/johnr-spindance/gists{/gist_id}","starred_url":"https://api.github.com/users/johnr-spindance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnr-spindance/subscriptions","organizations_url":"https://api.github.com/users/johnr-spindance/orgs","repos_url":"https://api.github.com/users/johnr-spindance/repos","events_url":"https://api.github.com/users/johnr-spindance/events{/privacy}","received_events_url":"https://api.github.com/users/johnr-spindance/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T20:29:06Z","updated_at":"2015-07-16T20:29:06Z","body":"We mainly wanted to get the control of when files are updated in our hands because things were getting out of control"}}