Merge pull request #7 from dgarbus/do_not_require_template_file
Do not require that a template file is passed to consul_template::watch
This commit is contained in:
Коммит
43af6c0a3d
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче