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

Package installs yum repo despite manage_repo setting #653

Closed
morrisjones opened this issue Jun 26, 2015 · 10 comments
Closed

Package installs yum repo despite manage_repo setting #653

morrisjones opened this issue Jun 26, 2015 · 10 comments
Labels
needs-feedback Further information is requested

Comments

@morrisjones
Copy link

I need to pick up a custom build of nginx from a local yum repository (RedHat based machines).

I have set

nginx::manage_repo: false

in hiera, and added for good measure

nginx::package::manage_repo: false

The module appears to add the nginx release repository to yum.repos.d regardless. I get the correct package of nginx installed, so the repo search order is correct, but I need to not have that extra repo on the machine.

@3flex
Copy link
Contributor

3flex commented Jun 26, 2015

If you delete the repo that's being added incorrectly, can you do a puppet run again and make sure that you see in the puppet run's output that the yum repo is being added by Puppet?

Taking a cursory look at the code it should not be adding the repo in this case. There's no complicated logic and we have spec test coverage too so there may be another cause (perhaps your hiera config isn't actually being applied?)

@3flex 3flex added the needs-feedback Further information is requested label Jun 26, 2015
@morrisjones
Copy link
Author

Here's a bit of log that shows it adding the repo:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for stage-ose-nginx001.mgs.example.com
Info: Applying configuration version '1435338936'
Notice: /Stage[main]/Profile::Sensu-client/Exec[gem-install-restclient]/returns: executed successfully
Notice: /Stage[main]/Nginx::Package::Redhat/Yumrepo[nginx-release]/ensure: created
Info: changing mode of /etc/yum.repos.d/nginx-release.repo from 600 to 644
Notice: /Stage[main]/Nginx::Package::Redhat/Package[nginx]/ensure: created
Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/nginx.conf]/content: 
--- /etc/nginx/nginx.conf   2014-09-16 13:54:29.000000000 +0000
+++ /tmp/puppet-file20150626-27281-1j0mc2t  2015-06-26 17:19:22.204503772 +0000

I'm really rusty on my hiera debugging, and I'm aware of common problems like a root level name being masked by another class downstream. Not having the hiera apply was my first thought, but I haven't figured out how to prove that it is or it isn't.

@3flex
Copy link
Contributor

3flex commented Jun 28, 2015

If you run with --debug you should be able to see all the stuff hiera's doing in the back end, see the files it's pulling it's config from and what config it's applying.

@tux-o-matic
Copy link

This is indeed annoying. We have a custom install (compiled Nginx) so no need for the YUM repo.

puppet-agent[15639]: (/Stage[main]/Nginx::Package::Redhat/Yumrepo[nginx-release]/ensure) created
puppet-agent[15639]: Could not get latest version: private method `warn' called for Puppet::Type::Package::ProviderYum:Class

Even though the configuration (JSON Hiera here) specifies:

"nginx::package_ensure": "absent",
"nginx::package::redhat::manage_repo": false

@3flex
Copy link
Contributor

3flex commented Aug 20, 2015

@tux-o-matic as I suggested above please run with --debug enabled so you can see more details about how hiera is processing its configuration.

@tux-o-matic
Copy link

So on node, something similar to the original message:

Notice: /Stage[main]/Nginx::Package::Redhat/Yumrepo[nginx-release]/ensure: created
Info: changing mode of /etc/yum.repos.d/nginx-release.repo from 600 to 644
Debug: /Stage[main]/Nginx::Package::Redhat/Yumrepo[nginx-release]: The container Class[Nginx::Package::Redhat] will propagate my refresh event

Yet on the master when using the hiera command to debug the right data is picked up:

$ ./hiera --debug nginx::package::redhat::manage_repo environment=13305 osfamily=RedHat
DEBUG: 2015-08-21 12:19:37 +0200: Hiera JSON backend starting
DEBUG: 2015-08-21 12:19:37 +0200: Looking up nginx::package::redhat::manage_repo in JSON backend
DEBUG: 2015-08-21 12:19:37 +0200: Looking for data source common_13305
false

This behaviour is happening in multiple environments and on both RHEL and CentOS.

@3flex
Copy link
Contributor

3flex commented Aug 21, 2015

@tux-o-matic sorry I meant to run puppet with --debug, not hiera. There may be a problem with how Puppet is integrating Hiera's data.

@tux-o-matic
Copy link

Well that's the first block of my last message, that's the interesting output of the run with --debug after I manually removed the repo file.

@3flex
Copy link
Contributor

3flex commented Sep 16, 2015

@tux-o-matic there should be output from hiera when --debug is used with the puppet command, that's what we need to see. I only see the resource changes in the first block of your last message, but I need to see how hiera's interacting.

Can you please post the full output when using --debug?

@tux-o-matic
Copy link

Finally worked it out. Of all combinations, there is only one place where it should and can be set (working on v0.2.7).

And that is on top level, nginx.pp, so in Hiera

nginx::manage_repo: false

Tested on both Centos 6.6 container and RedHat 6.7 server.
Precision for @morrisjones, I also specified from the start this:

nginx::package_ensure: absent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants