-
Notifications
You must be signed in to change notification settings - Fork 290
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
Added parameter sensu::install_repo as the first condition to manage … #475
Conversation
|
Where is the second declaration of |
|
I've defined this resource using hiera and create_resources. The check of this PR is as it is performed for yum repos. |
|
The packages create a repo with the name of |
|
That's true, I could change just the name of the resource in hiera to solve the duplicated resource, but I did not explained myself well above. In this way, the definition of this resource in the sensu module produces a circular dependency when used with stages, even when it is declared as absent by means of setting This PR tries to solved this circular dependency by avoiding the declaration of the apt resource when the parameter install_repo is set to false. |
|
I just hit the same issue today. |
|
I'm not a fan of removing the management of the repo if install_repo is false because then the repo installed with the package never gets removed. For your stage setup, what about just adding Apt { stage => 'provisioning' } |
|
I'm thinking in another option to keep both approaches. This new parameter 'manage_repo' would handle the apt resource definition and install_repo will keep enabling or removing the new repo as previously. Adding this parameter will allow us to break the circular dependency when stages are used if it is redefined by means of hiera. |
|
I could go for that. I don't like adding additional (potentially confusing) parameters, but I understand the problem and can't think of anything else. Could you wrap the yum repo as well with it? |
|
Thanks! |
|
Perfect! If you get this in the next day or two I'll get it in the next release I need to push up. |
43ffd50
to
8498410
Compare
|
I've updated the PR adding the new variable $manage_repo in two conditions. About yum, Introducing these changes into yum repos is not an easy task. |
|
What about instead of putting it in the repo::type class we just put it in |
|
I'll give it a try |
8498410
to
01dcf8f
Compare
|
Updated the PR, moving the condition using |
|
Awesome! looks a whole lot cleaner. One last request and then I'll merge it and do a release today - can you throw a couple tests in for |
01dcf8f
to
7445ffc
Compare
|
I've added some tests to check the behavior using manage_repo variable |
|
Thanks! Release coming shortly as well. |
Added parameter sensu::install_repo as the first condition to manage …
Currently, if a user does not want to install the repositories by setting the parameter class install_repo to false, and this is declared in hiera, there is an error about duplicated resources apt::source (resource declared in manifests/repo/apt.pp file).
This PR changes the checks of the if statement to avoid this error about duplicated resources.