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

Sensu-client service enable is not idempotent on CentOS 7 #448

Closed
jrwesolo opened this issue Nov 20, 2015 · 7 comments
Closed

Sensu-client service enable is not idempotent on CentOS 7 #448

jrwesolo opened this issue Nov 20, 2015 · 7 comments

Comments

@jrwesolo
Copy link

I am currently trying to use this module to configure sensu-client on both CentOS 6 and 7 nodes. Everything works perfectly on CentOS 6 and it is idempotent. On CentOS 7 it will always think that the sensu-client service is not enabled and then enable it. Here is the output I get every run:

Notice: /Stage[main]/Sensu::Client::Service/Service[sensu-client]/enable: enable changed 'false' to 'true'

I suspect this is because the sensu package does not use systemd natively. There is a pull request open currently sensu/sensu-build#122. I'll wanted to open up an issue here to see if anyone else has this issue and if they were able to solve it.

@jrwesolo
Copy link
Author

Not sure if it matters, but I was also using the sensu_plugin_provider => 'sensu_gem' when declaring the sensu class so it would use the embedded ruby.

@jlambert121
Copy link
Contributor

I noticed this when I upgraded to puppet 4.2.2 and not having native systemd unit files was my guess too, but I haven't had any time to investigate.

@jrwesolo
Copy link
Author

Ah yes, forgot to mention I am also on Puppet 4.2.2.

@jbehrends
Copy link
Contributor

I had this same issue after I moved to 4.2.2 too.

I did some investigation and found the issue. Sensu is not configured to use SystemD. So on Cent7 puppet will ask SystemD what the service startup status is. SystemD has no idea and returns either no value or a value that states unknown. This results in every puppet run trying to set the state to "enabled".

I ended up fixing this though in my local copy of the Sensu module by adding "provider => 'redhat'" to all of the service definitions. So it might be good to add some logic to the module so if your using a redhat based os to use a provider of "redhat" vs letting puppet just figure it out.

@jrwesolo
Copy link
Author

@jbehrends Hmmm, that makes sense. Thanks for providing your research!

@jlambert121 What do you recommend? I could create a pull request for this, but once sensu is packaged to use systemd natively that logic won't work right. My initial thought was waiting until the CentOS 7 package uses systemd and then just make sure I use that version going forward.

@ltutar
Copy link

ltutar commented Jan 5, 2016

Maybe this would help https://tickets.puppetlabs.com/browse/PUP-5296

@jaxxstorm
Copy link
Contributor

I don't think this is related to the module itself, it's an upstream problem with sensu and Puppet 4. I'm going to close it based on that

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

No branches or pull requests

5 participants