rackerlabs / auter

Automatic updates for RHEL, Debian, and their derivatives, with the ability to run pre/post hooks & reboot afterwards.
Apache License 2.0
67 stars 18 forks source link

auter --prep and auter --apply should log how many packages downloaded/installed. #199

Closed mark-hyde closed 5 years ago

mark-hyde commented 6 years ago

Hi,

It would be useful if auter --prep indicated in the logs how many packages it has downloaded. It would be useful if auter --apply indicated in the logs how many packages it has installed/updated.

This would be useful for any reporting tools, and also to compare that the --apply and --prep were consistent. Regards Mark

reaperzn commented 6 years ago

@racker-markh This is easily achievable with pre/post scripts assessing the output of the logs in /var/lib/auter. Additionally, if you are using configsnap then you could do a diff (or add a post-script to do the diff) of packages.{pre,post}

If there is a need for the patches to be consistent then the "ONLYINSTALLFROMPREP" option should be set to "yes"

mark-hyde commented 6 years ago

Hi @reaperzn We're already using the onlyinstallfromprep option.

This request was inspired by the thought that it would be good to validate that the same number of patches which were downloaded during prep were installed during the apply.

I can think of a few scenarios where this might be the case (for instance if someone did a yum update packagename between the prep and apply, or perhaps if there were a change to the exclude line in yum.conf.

In addition it would be useful if patching a large number of servers that you could see that (say) if most servers had around 20-30 updates, but perhaps 1-2 had 300 packages while another couple had 0, it might trigger that we investigate why this subset of servers were different.

I appreciate that this can all be done with pre/post hooks, but wanted to raise it as a feature because it might be easier to count these things during the script itself rather than (say) counting files in a directory before/after the event.

It's not a critical issue though, just a suggestion.

rhodesn commented 5 years ago

I've put a PR in for adding package dependant rebooting into Auter - it also includes a package prep and install count.

https://github.com/rackerlabs/auter/blob/cd55d4b641ee5cb0271be4e5b03f50033a7202b0/auter.yumdnfModule#L83

It just appends the count to the end of what was added #214, eg:

STATUS:SUCCESS:Package download complete:10

What do you think?

mark-hyde commented 5 years ago

Looks good to me!

rhodesn commented 5 years ago

Added in #220