Open slvr32 opened 2 years ago
I figured out a solution with a tidy
resource, using the following in a related puppet manifest
I have a bit of custom logic to create .rules
files in the prometheus::config_dir/rules
directory, but a tidy
resource following the .rules
files creation worked as I was hoping, not deleting .rules
files that were already managed by puppet.
$config_dir = lookup('prometheus::config_dir')
tidy { "${config_dir}/rules":
matches => '*.rules',
recurse => true,
}
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Create a file resource for
$prometheus::server::config_dir/rules
in a puppet profileWhat are you seeing
notice the file resource conflict with the forge prometheus module
What behaviour did you expect instead
It would be nice to have a
prometheus::server::purge_rules
toggle for the${config_dir}/rules
file resource, to facilitate purging of old/unmanaged.rules
files for a prometheus instance, so that that toggle could be used in the${config_dir}/rules
file resource inserver.pp
Output log
Any additional information you'd like to impart