Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prometheus::server:purge_rules parameter to enable purging in ${config_dir}/rules file resource? #631

Open
slvr32 opened this issue Aug 3, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@slvr32
Copy link

slvr32 commented Aug 3, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.x
  • Ruby: 1.8.x
  • Distribution: Oracle Linux
  • Module version: 11.2.0

How to reproduce (e.g Puppet code you use)

Create a file resource for $prometheus::server::config_dir/rules in a puppet profile

What 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 in server.pp

Output log

Any additional information you'd like to impart

@slvr32
Copy link
Author

slvr32 commented Aug 3, 2022

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,
}

@TheMeier TheMeier added the enhancement New feature or request label May 20, 2024
@TheMeier TheMeier self-assigned this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants