Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 64b5fa6, source or template must be defined for consul_template::watch resources #52

Closed
JayH5 opened this issue Dec 21, 2015 · 1 comment

Comments

@JayH5
Copy link
Contributor

JayH5 commented Dec 21, 2015

In version 0.2.3 you could do something like the following:

file { '/etc/consul-template/my-template.ctmpl':
  source => 'puppet:///modules/my-module/my-template.ctmpl',
}
~>
consul_template::watch { 'my-template':
  destination => '/etc/nginx/sites-enabled/my-site.conf',
  command     => 'service nginx reload',
}

Since 0.2.4 (specifically, 64b5fa6) If neither $template nor $source are specified then the $frag_name variable in consul_template::watch is never set and the concat::fragment resource fails.

This is not the end of the world as you can just set $source but it breaks backwards-compatibility and isn't documented. I actually prefer the new behaviour as it is more explicit but somebody could have the same problem so I made an issue.

An additional problem is if both $source and $template are specified - in that case it is likely that things will break. Perhaps it makes sense to add a check if either both or neither parameters are set and throw an error if that is the case.

gdhbashton added a commit that referenced this issue Jan 18, 2016
gdhbashton added a commit that referenced this issue Jan 18, 2016
@gdhbashton
Copy link
Contributor

Thanks for the report, I've just pushed a little fix to master for this - I do prefer to keep backwards compatibility :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants