Foreman-installer runs foreman-rake upgrade:run every time

Problem:
Every time we run the foreman-installer it executes foreman-rake upgrade:run.

I found out it is caused by the hook /usr/share/foreman-installer/hooks/post/30-upgrade.rb.

And i believe our we encounter this because we set the following in /etc/foreman-installer/scenarios.d/katello.yaml:

:custom:
  :lock_package_versions: false

This has been set via the flag --no-lock-package-versions with the installer. Our Problem is their seems to be not way to reset this option. I can only set it to true or false.

Expected outcome:
I want the installer to remove the :lock_package_versions: option so that the foreman-installer does not exec foreman-rake upgrade:run on every run.

Foreman and Proxy versions:
Foreman/Proxy 3.10 Katello 4.12
Foreman and Proxy plugin versions:
Foreman/Proxy 3.10 Katello 4.12
Distribution and version:
RHEL 8.10
Other relevant data:

lock_package_versions and the upgrade:run are not related, no.

You can avoid running it by setting :run_rake_upgrade: false in :custom.

But then you’re responsible yourself to run it when it necessary :slight_smile:

Hmm @evgeni , do you know what the hook in /usr/share/foreman-installer/hooks/post/30-upgrade.rb checks to determine that foreman-rake upgrade:run has to run?

Does it run every time we execute the foreman-installer on a Katello system?
We have enough CVs and Repositories that the Installer runs Upgrade Step 1/2: katello:correct_repositories. This may take a long while. for about 20 mins. Is that needed on every run?
Or is it only needed if their are changes in the Katello Plugin itself?

If there would be a better heuristic, the hook would do it :disappointed:

But yeah, it’s only needed if there were changes to this upgrade task. Detecting it is hard tho.
I guess (!) “on every change of rubygem-katello” is a good indicator (but the installer sadly doesn’t know if it changed).

Ok that is a bummer, but now I know how it works and that :run_rake_upgrade: false exists. Their is no installer flag which sets this or am I just blind?

Hmm would it be possible to note the rpm or gem version with which the installer ran the last time and the check on the next time if the gem or rpm has changed? But I think their would be other challanges with such a state file.

There is no flag for that, no

Ok, but thank you for your help :slight_smile: I’m a little bit smarter now and less confused :smiley:

1 Like