Do not require that we manage the consul template from a puppet-provided
erb
This commit is contained in:
Родитель
f0cb648b53
Коммит
65fe9cd053
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче