Sometimes, things don't go as planned and, so did a monthly patching job where I work at.
Long story short, the satellite installation was broken with packages from 6.7 (Foreman 1.24) while Satellite was upgraded the way it's supposed to be done ... so it was partially broken.
I found these few commands to fix a lot of problems with satellite (or foreman for that matter), so I would consider them quite helpful.
First, run the installer with the respective scenario and tell it to upgrade. I'll run all of this in a tmux session just in case if I loose the connection or anything else happens to my workstation.
[root@satellite ~]# tmux new -s fix_satellite
[root@satellite ~]# foreman-maintain service restart
[root@satellite ~]# foreman-installer --scenario satellite --upgrade
This might take a while. Once the installer has (hopefully) successfully finished, continue to clean up old tasks that might cause problems.
[root@satellite ~]# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' AFTER='30d' VERBOSE=true
Depending on how much it finds, this can take a lot of time. In my example, it cleaned out around ~1.2 million items in ~15 minutes.
Now that you have cleaned up satellite, it's time to let it run the upgrade process so that you'll be having a clean state in terms of upgrades.
# foreman-maintain upgrade list-versions
[root@satellite ~]# foreman-maintain upgrade list-versions
6.7.z
[root@satellite ~]# foreman-maintain upgrade check --target-version 6.7.z
This will run the checks and set the satellite host in maintenance mode. If no single check has failed, you can continue running the upgrade.
[root@satellite ~]# foreman-maintain upgrade run --target-version 6.7.z
The Update should complete successfully and satellite should work as expected again.
Feel free to comment and / or suggest a topic.
Comments
Post a Comment