philicious / spacewalk-client-chef

Chef cookbook for installing the client component of Spacewalk
GNU General Public License v2.0
5 stars 8 forks source link

Not Spacewalk repos disabling #9

Open rosario-mattera opened 7 years ago

rosario-mattera commented 7 years ago

After the first successful execution of the rhel.rb recipe, the node on which has still repos not belonging to Spacewalk configured on it. In the recipe should be added something to replace "enabled" properties in /etc/yum.d.repos/* to "0" I guess.

philicious commented 7 years ago

thats right. and also the case for ubuntu.rb recipe. When I did these recipes, I didnt require Spacewalk to be the only source. I'm not working with Spacewalk or Chef atm but I'd take a PR if you feel like doing one.

(Also, I think I never tested this cookbook with Spacewalk >2.3 and latest is 2.6 so it might require more fixes. And there might be new versions to the packages mentioned in README)

rosario-mattera commented 7 years ago

I'm using rhel recipe on Spacewalk 2.6 and what I see is that "include_recipe yum-epel" is not a required step, thus I've commented it on my local instance. Anyway it's working fine on Centos7 systems. I'm going to disable other repos before to register on Spacewalk using this portion of code

Disable non Spacewalk repos

execute 'disable-non-spacewalk-repos' do command "yum-config-manager --disable \*" not_if { (File.exist?('/etc/sysconfig/rhn/systemid')) } end

philicious commented 7 years ago

Hi @rosario-mattera hm. According to the official Wiki EPEL is required (see https://github.com/spacewalkproject/spacewalk/wiki/HowToInstall) but seems like Java is also available from CentOS repos. However I got several packages from EPEL installed which are required for e.g. OSAD if I'm not mistaken.

About disabling repos: I could add this as a flag but I dont want to enforce it as there are common scenarios where you do want to have all/some still enabled.

rosario-mattera commented 7 years ago

Thank you philicious for your response. At the end, I've decided to not disable the local repositories because often there are third party repos configured that will not be available after the registration on spacewalk. Anyway, if I'm not wrong, when a node is registered on spacewalk and a new package installation is required, yum first searches on the Spacewalk server for the RPM and only if it's not found, it looks in the local configured repos. Do you agree with this last sentence?

About the EPEL, I've checked on the official documentation and also your previous link about EPEL is referred to the Spacewalk Server, not the client. Anyway, because of I'm not going to use OSAD feature, I'm confident the EPEL is not required for the init of the node on the Spacewalk infrastructure.

Thanks a lot and have a good day, Rosario

philicious commented 7 years ago

You could also run in a "mixed mode", disabling repos that are available from SW and leaving those enabled that are not.

I'm not sure how exactly yum-rhn-plugin changes the order, would have to check myself. In general, yum will search repositories by their priority which you can change, see https://wiki.centos.org/PackageManagement/Yum/Priorities

EPEL: ye you are right, my link was for the server :/ However, I just tried a Chef test-kitchen converge without yum-epel and its indeed failing because of OSAD. But if you dont need that, you wont need EPEL repo.

       STDERR: Error: Package: osa-common-5.11.74-1.el7.noarch (spacewalk-client)
           Requires: jabberpy
       Error: Package: osad-5.11.74-1.el7.noarch (spacewalk-client)
           Requires: jabberpy