Do not require that we manage the consul template from a puppet-provided

erb
This commit is contained in:
Dave Garbus 2015-03-05 16:12:46 -06:00
Родитель f0cb648b53
Коммит 65fe9cd053
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -4,17 +4,19 @@
# This is a single instance of a configuration file to watch
# for changes in Consul and update the local file
define consul_template::watch (
$template,
$template = undef,
$destination,
$command,
) {
include consul_template
file { "${consul_template::config_dir}/${name}.ctmpl":
ensure => present,
content => template($template),
} ->
if $template != undef {
file { "${consul_template::config_dir}/${name}.ctmpl":
ensure => present,
content => template($template),
before => Concat::Fragment["${name}.ctmpl"],
}
}
concat::fragment { "${name}.ctmpl":
target => 'consul-template/config.json',
content => "template {\n source = \"${consul_template::config_dir}/${name}.ctmpl\"\n destination = \"${destination}\"\n command = \"${command}\"\n}\n\n",