Custom yum repos and package upgrade question #6271
-
|
Hello, I'm trying to configure a local set of yum repos hosted on a local pulp server and remove/disable the default repos to prevent internet access. My user config looks like this # Create local repo files
yum_repos:
local-almalinux-appstream:
name: almalinux-appstream
baseurl: 'https://<INTERNAL_SERVER>/pulp/content/rpm/almalinux-appstream/'
repo_gpgcheck: false
gpgcheck: false
enabled: true
# Package install
package_reboot_if_required: true
package_upgrade: true
# Startup command runs
runcmd:
- "rm -vf /etc/yum.repos.d/almalinux-*.repo"
Looking at the cloud-init log the order of operations is yum_add_repo > runcmd > package_upgrade. Any idea what I'm doing wrong here? In a perfect world I should be able to override any existing repo files with a force flag or something, right now it skips files that already exist. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Thanks for this question @Omripresent. Runcmd is a confusing one because the scripe rendered Per typical /etc/cloud/cloud.cfg module ordering runcmd should run at the tail end of the modules:config stage. But this module only renders a runcmd script to /var/lib/cloud/instance/scripts/runcmd which ultimately gets run during the module cc_scripts_user. That module is ordered later than In your case, I'd suggest dropping the Another alternative, if you knew all repo files you needed to remove, you could provide Since write_files is run before |
Beta Was this translation helpful? Give feedback.
Thanks for this question @Omripresent. Runcmd is a confusing one because the scripe rendered
Per typical /etc/cloud/cloud.cfg module ordering runcmd should run at the tail end of the modules:config stage. But this module only renders a runcmd script to /var/lib/cloud/instance/scripts/runcmd which ultimately gets run during the module cc_scripts_user.
That module is ordered later than
package_update_upgrade_installwhich is activated by yourpackage_upgrade: trueconfig because typically runcmd operations like to take advantage of packages provided by newly added repositories.In your case, I'd suggest dropping the
package_upgrade: trueand pulling out yourdnf updateordnf -y upgradeint…