The answer is that it depends on how you initiate the update. @iNecas is correct in that we do not store a historical record the package_profile over time for a host. If you initiate the package updates through Katello then there is a way to get a record of the updates post-action by way of the task data.
Take into account the following caveats:
- If you initiate a yum update from the client, then the yum.log is your only way to get some record of what transpired
- If you need this task output to be historical, ensure that any task purging you do does not clear these from the database
For any update action that kicked off a package update via katello-agent, get the task ID and go to:
/foreman_tasks/api/tasks/<task_id>
Depending on if the task was initiated by selecting packages or clicking ‘update all’, you should see the package list in one or more of the following fields:
- output – the resulting updates from the task
- packages – if you selected packages individually
- input – the packages selected for update
I believe you can do the same and get similar output via using remote execution that shows up in the input field of the task output.
Here is an example task output to help:
{
"id": "13dc7914-a1b9-41f7-8bcd-871da5100f4b",
"label": "Actions::Katello::Host::Package::Update",
"pending": false,
"username": "ehelms",
"started_at": "2018-02-23 19:33:08 UTC",
"ended_at": "2018-02-23 19:33:20 UTC",
"state": "stopped",
"result": "success",
"progress": 1,
"input": {
"host": {
"id": 1582,
"name": "el7.woodford.example.com"
},
"packages": [
"libgudev1-219-42.el7_4.7.x86_64",
"systemd-219-42.el7_4.7.x86_64",
"systemd-libs-219-42.el7_4.7.x86_64",
"systemd-sysv-219-42.el7_4.7.x86_64",
"vim-common-7.4.160-2.el7.x86_64",
"vim-enhanced-7.4.160-2.el7.x86_64",
"vim-filesystem-7.4.160-2.el7.x86_64",
"vim-minimal-7.4.160-2.el7.x86_64"
],
"services_checked": [
"pulp",
"pulp_auth"
]
},
"output": {},
"humanized": {
"action": "Update package",
"input": [
"libgudev1-219-42.el7_4.7.x86_64, systemd-219-42.el7_4.7.x86_64, systemd-libs-219-42.el7_4.7.x86_64, systemd-sysv-219-42.el7_4.7.x86_64, vim-common-7.4.160-2.el7.x86_64, vim-enhanced-7.4.160-2.el7.x86_64, vim-filesystem-7.4.160-2.el7.x86_64, vim-minimal-7.4.160-2.el7.x86_64"
],
"output": "2:vim-common-7.4.160-2.el7.x86_64\n2:vim-enhanced-7.4.160-2.el7.x86_64\n2:vim-filesystem-7.4.160-2.el7.x86_64\n2:vim-minimal-7.4.160-2.el7.x86_64",
"errors": []
},
"cli_example": null
}