Skip to content

Commit 61af1d8

Browse files
authored
Merge pull request #1192 from stackhpc/package-repo-option
Add unified stackhpc_repos_enabled group var
2 parents f40f481 + 42d348b commit 61af1d8

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

etc/kayobe/apt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ stackhpc_apt_repositories:
7474
# Do not replace apt configuration for non-overcloud hosts. This can result in
7575
# errors if apt reconfiguration is performed before local repository mirrors
7676
# are deployed.
77-
apt_repositories: "{{ stackhpc_apt_repositories | selectattr('required') | list if 'overcloud' in group_names else [] }}"
77+
apt_repositories: "{{ stackhpc_apt_repositories | selectattr('required') | list if stackhpc_repos_enabled | bool else [] }}"
7878

7979
# Whether to disable repositories in /etc/apt/sources.list. This may be used
8080
# when replacing the distribution repositories via apt_repositories.
8181
# Default is false.
8282
# Do not disable the default apt configuration for non-overcloud hosts. This
8383
# can result in errors if apt reconfiguration is performed before local
8484
# repository mirrors are deployed.
85-
apt_disable_sources_list: "{{ 'overcloud' in group_names }}"
85+
apt_disable_sources_list: "{{ stackhpc_repos_enabled | bool }}"
8686

8787
# Apt auth configuration for accessing the package repository mirror.
8888
stackhpc_apt_auth:
@@ -98,7 +98,7 @@ stackhpc_apt_auth:
9898
# * filename: Name of a file in which to store the auth configuration. The
9999
# extension should be '.conf'.
100100
# Default is an empty list.
101-
apt_auth: "{{ stackhpc_apt_auth if 'overcloud' in group_names and stackhpc_repo_mirror_username is truthy else [] }}"
101+
apt_auth: "{{ stackhpc_apt_auth if stackhpc_repos_enabled | bool and stackhpc_repo_mirror_username is truthy else [] }}"
102102

103103
###############################################################################
104104
# Dummy variable to allow Ansible to accept this file.

etc/kayobe/dnf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
# file: myrepo
4242
# gpgkey: http://gpgkey
4343
# gpgcheck: yes
44-
#dnf_custom_repos:
44+
dnf_custom_repos: "{{ stackhpc_dnf_repos if stackhpc_repos_enabled | bool else [] }}"
4545

4646
# A dict of custom repositories that point to the local Pulp server.
47-
# To use these repos, set dnf_custom_repos to the value of stackhpc_dnf_repos.
47+
# To use these repos, set stackhpc_repos_enabled to true.
4848
# This is done by default for hosts in the overcloud group via a group_vars
4949
# file.
5050
stackhpc_dnf_repos: "{{ dnf_custom_repos_el9 | combine(dnf_custom_repos_rocky_9) | combine(dnf_custom_repos_elrepo_9 if dnf_install_elrepo_9 | bool else {}) }}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# Use upstream package repos by default to avoid situations where the
3+
# seed-hypervisor tries to use a local pulp repo on the seed VM before the seed
4+
# vm has been provisioned
5+
# This behaviour is overriden for Overcloud hosts.
6+
stackhpc_repos_enabled: false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
---
12
# Only use local pulp mirrors for overcloud hosts
23
# to avoid situations where the seed-hypervisor
34
# tries to use a local pulp repo on the seed VM
45
# before the seed vm has been provisioned
5-
dnf_custom_repos: "{{ stackhpc_dnf_repos }}"
6-
6+
stackhpc_repos_enabled: true
77
enable_docker_repo: false
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
Added a new group variable - ``stackhpc_repos_enabled`` - for unified
5+
control over usage of StackHPC Release Train package repositories. This
6+
makes it easier to set which hosts do or do not pull packages from release
7+
train.

0 commit comments

Comments
 (0)