Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

should notify only if service is managed #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

narkisr
Copy link

@narkisr narkisr commented May 6, 2015

No description provided.

}

if($::uchiwa::manage_services == true){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please just say if $::uchiwa::manage_services { } for style

@solarkennedy
Copy link
Contributor

Can you take out the apt-change? This module does actually require apt, and there is a different PR to update it to use the newer puppet-labs-apt api.

@narkisr
Copy link
Author

narkisr commented Sep 15, 2015

Ok, just did

iv also made a small if statement change

Thanks

}

if $::uchiwa::manage_services {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this change? It is too specific and operating directly on the package.

It belongs in the init class

Class['Uchiwa::install'] ~> Class['uchiwa::service']

And then let the manage_services gate inside the service class handle whether or not to do anything.

@narkisr
Copy link
Author

narkisr commented Sep 16, 2015

Sorry but I don't understand what you mean, if ill remove the if statement the code will fail in cases that the service isn't managed (see https://github.com/Yelp/puppet-uchiwa/blob/master/manifests/install.pp#L44)

@solarkennedy
Copy link
Contributor

Yes, but this logic doesn't belong in the install class.

Keep all the "if $manage_services" logic in the service class.

Any notifications need to happen in the init class on the entire classes, not just the package resource.

Like this pattern: https://www.devco.net/archives/2012/12/13/simple-puppet-module-structure-redux.php

@solarkennedy
Copy link
Contributor

Can you rebase against master if you are still interested in getting this change in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants