Skip to content

Commit

Permalink
Merge pull request #1033 from sp-ricard-valverde/fix/collectd-python-…
Browse files Browse the repository at this point in the history
…absent-module

Ensure absent python module config
  • Loading branch information
kenyon authored Nov 23, 2023
2 parents f7d7c5d + a7926af commit 3a029e8
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions manifests/plugin/python/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,31 @@
}
}

# Exactly one per module.
ensure_resource('concat::fragment',"collectd_plugin_python_conf_${module}_header",
{
'order' => "50_${module}_00",
'target' => $collectd::plugin::python::python_conf,
'content' => epp('collectd/plugin/python/module.conf_header.epp',
if $ensure == 'present' {
# Exactly one per module.
ensure_resource('concat::fragment',"collectd_plugin_python_conf_${module}_header",
{
'order' => "50_${module}_00",
'target' => $collectd::plugin::python::python_conf,
'content' => epp('collectd/plugin/python/module.conf_header.epp',
{
'module_import' => $_module_import,
},
),
}
)

# Possibly many per instance of a module configuration.
concat::fragment { "collectd_plugin_python_conf_${title}_config":
order => "50_${module}_50",
target => $collectd::plugin::python::python_conf,
content => epp('collectd/plugin/python/module.conf_config.epp',
{
'module_import' => $_module_import,
'title' => $title,
'config' => $config,
'module' => $_module_import,
},
),
}
)

# Possibly many per instance of a module configuration.
concat::fragment { "collectd_plugin_python_conf_${title}_config":
order => "50_${module}_50",
target => $collectd::plugin::python::python_conf,
content => epp('collectd/plugin/python/module.conf_config.epp',
{
'title' => $title,
'config' => $config,
'module' => $_module_import,
},
),
}
}

0 comments on commit 3a029e8

Please sign in to comment.