stdevel / katprep

Python toolkit for automating system maintenance and generating patch reports along with Foreman/Katello and Red Hat Satellite 6.x
GNU General Public License v3.0
35 stars 6 forks source link

Also install package updates #33

Closed stdevel closed 6 years ago

stdevel commented 7 years ago

Beginning with Foreman 1.14.3, non-errata package updates can be triggered/installed using the UI - would be handy if katprep_maintenance could do the same.

stdevel commented 7 years ago

Unfortunately, the Foreman API currently offers no call for this.

stdevel commented 6 years ago

Things have changed, yas: https://theforeman.org/plugins/katello/3.5/api/apidoc/v2/host_packages.html

PUT /api/hosts/:host_id/packages/upgrade_all 
Update packages remotely
stdevel commented 6 years ago

Investigating in branch feature-pkg_updates-issue33

stdevel commented 6 years ago

Was thinking about adding an exclude parameter to katprep_maintenance - unfortunately I found no way to implement this. The API call upgrade_all upgrades all packages, while upgrade requires a list of package IDs. For this it would be necessary to have a list of "upgradable" packages for a particular host - and there is no such API call.

stdevel commented 6 years ago

In the web interface it is possible to list available package upgrades, so there must be a way to retrieve this information. Gonna ask the developers.

stdevel commented 6 years ago

In the web interface it is possible to list available package upgrades, so there must be a way to retrieve this information. Gonna ask the developers. Discussion started: https://community.theforeman.org/t/looking-for-api-call-for-retrieving-upgradable-packages-per-content-host/9985

stdevel commented 6 years ago

Added code for installing all available package upgrades in commit 63ba47a6daaf19bd9e17f7b5f1e24ec7a795a5e5. Successfully tested with Foreman 1.17.1 and Katello 3.6.