voxpupuli / puppet-yum

Puppet module for Yum
https://forge.puppet.com/puppet/yum
MIT License
16 stars 101 forks source link

Add support for yum facts (similar to the apt ones) #141

Closed smortex closed 4 years ago

smortex commented 5 years ago

Pull Request (PR) description

This PR add a bunch of facts similar to the ones provided by the apt module:

e.g.

% facter yum_has_updates yum_package_updates yum_reboot_required yum_updates
yum_has_updates => true
yum_package_updates => [
  "puppet-agent.x86_64"
]
yum_reboot_required => true
yum_updates => 1
% facter yum_has_updates yum_package_updates yum_reboot_required yum_updates
yum_has_updates => false
yum_package_updates => []
yum_reboot_required => false
yum_updates => 0

This Pull Request (PR) fixes the following issues

n/a

TJM commented 5 years ago

You might check out the https://forge.puppet.com/albatrossflavour/os_patching module, which already does this sort of thing, but has taken into account the time impact during puppet runs. I would recommend against running yum commands for each facter run.

ekohl commented 4 years ago

You might check out the https://forge.puppet.com/albatrossflavour/os_patching module, which already does this sort of thing, but has taken into account the time impact during puppet runs. I would recommend against running yum commands for each facter run.

This is a good thing to keep in mind. I don't know if this reaches out to a subscription service, but we've seen Satellite servers get heavily overloaded when using ensure => latest in large scale deployments.

smortex commented 4 years ago

This is a good thing to keep in mind. I don't know if this reaches out to a subscription service, but we've seen Satellite servers get heavily overloaded when using ensure => latest in large scale deployments.

We deployed it 6 month ago. We contributed patches to fix it / make it work on the various systems we use… Unfortunately it's still "meh" and we are considering to remove it :disappointed:.

smortex commented 4 years ago

I had a local commit for supporting a "list updates" task that I never pushed.

Because of the test failure around the cache and as I suggested in https://github.com/voxpupuli/puppet-yum/pull/141#discussion_r308020361 I added two commits to ensure the repositories are not automatically updated when Puppet runs and to allow refreshing the packages with MCollective / Choria / Bolt.

smortex commented 4 years ago

@ekohl sure! There is still the test suite idempotency discussion that is annoying me because I do not understand the intention but I believe it's not testing what it tries… Should we track this in another issue?

Once everybody is happy with the changes, I'd like to squash the commits: I refrained to do it recently because it's a bit painful for reviewers to focus on the changes, but the history does not really makes sense right now :laughing:

smortex commented 4 years ago

All listed reviewers have approved the change. Let's squash related commits!