claranet / puppet-consul_template

A Puppet module to manage the config and jobs of Consul Template from Hashicorp
Apache License 2.0
30 stars 89 forks source link

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

Closed JayH5 closed 8 years ago

JayH5 commented 8 years ago

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 commented 8 years ago

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