Skip to content

Commit

Permalink
build,script,salt: Pin salt version in bootstrap and restore
Browse files Browse the repository at this point in the history
In bootstrap and restore we install salt-minion on the node so we need
to pin the salt version we want to install and not just install the one
yum will find depending on various things (like available versions,
priority on repos, ...).
Also set the priority to 1 on all our repos so that our repositories has
priority over others if the `yum-plugin-priorities` package is
installed.
NOTE: If `yum-plugin-priorities` is installed and priority is set on one
repos then other repos with the same package will just be ignored
(e.g.: epel installed with priority=98 we cannot install `salt-3000.3`
as salt-3000.3 is excluded because a repo with some priority has the
package in a different version)

Fixes: #2704
  • Loading branch information
TeddyAndrieux committed Aug 11, 2020
1 parent 44033f3 commit e869013
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions buildchain/buildchain/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
task_name='bootstrap.sh',
source=constants.ROOT/'scripts'/'bootstrap.sh.in',
destination=constants.ISO_ROOT/'bootstrap.sh',
context={'VERSION': versions.VERSION},
context={
'VERSION': versions.VERSION,
'SALT_VERSION': versions.SALT_VERSION
},
file_dep=[versions.VERSION_FILE],
task_dep=['_iso_mkdir_root'],
),
Expand All @@ -101,7 +104,10 @@
task_name='restore.sh',
source=constants.ROOT/'scripts'/'restore.sh.in',
destination=constants.ISO_ROOT/'restore.sh',
context={'VERSION': versions.VERSION},
context={
'VERSION': versions.VERSION,
'SALT_VERSION': versions.SALT_VERSION
},
file_dep=[versions.VERSION_FILE],
task_dep=['_iso_mkdir_root'],
),
Expand Down
3 changes: 3 additions & 0 deletions salt/metalk8s/repo/redhat.sls
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Configure {{ repo_name }} repository:
{%- endif %}
- repo_gpg_check: {{ repo_config.repo_gpg_check }}
- enabled: {{ repo_config.enabled }}
# Set priority to 1, even if the `yum-plugin-priorities` is not installed,
# so that our repos has priority over others
- priority: 1
# URL to the proxy server for this repository.
# Set to '_none_' to disable the global proxy setting
# for this repository.
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ BASE_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
SALT_CALL=${SALT_CALL:-salt-call}

declare -a PACKAGES=(
salt-minion
salt-minion-@@SALT_VERSION
genisoimage
)

Expand Down
1 change: 1 addition & 0 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ configure_yum_local_repository() {
name=$repo_name
baseurl=file://$repo_path
enabled=1
priority=1
gpgcheck=$gpgcheck
${gpg_keys:+gpgkey=${gpg_keys%?}}
EOF
Expand Down
2 changes: 1 addition & 1 deletion scripts/restore.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ BASE_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
SALT_CALL=${SALT_CALL:-salt-call}

declare -a PACKAGES=(
salt-minion
salt-minion-@@SALT_VERSION
genisoimage
)

Expand Down

0 comments on commit e869013

Please sign in to comment.