Skip to content

Commit 17df27b

Browse files
committed
fix: 🐛 Updating photon gpg keys should not enable disabled repo
Refreshing the gpg keys for photon upstream repo causes disabled repos(when disable_public_repos is enabled) to get enabled. As a result if there are extra_repos configured, instead of using the extra_repos to pull packages, packages are pulled from public repos. This breaks the functionality of `disable_public_repos` flag
1 parent 896c21a commit 17df27b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

images/capi/ansible/roles/setup/tasks/photon.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
ansible.builtin.command: tdnf update -y photon-repos --enablerepo=photon --refresh
2727
register: distro
2828
changed_when: '"Nothing to do" not in distro.stderr'
29+
when: not disable_public_repos|default(false)|bool
2930

3031
- name: Perform a tdnf distro-sync
3132
ansible.builtin.command: tdnf distro-sync -y --refresh

images/capi/ansible/roles/sysprep/tasks/photon.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343

4444
- ansible.builtin.import_tasks: rpm_repos.yml
4545

46+
- name: Update the repos package to import the recent gpg keys
47+
ansible.builtin.command: tdnf update -y photon-repos --enablerepo=photon --refresh
48+
register: distro
49+
changed_when: '"Nothing to do" not in distro.stderr'
50+
when: disable_public_repos|default(false)|bool and reenable_public_repos|default(true)|bool
51+
4652
- name: Remove tdnf package caches
4753
ansible.builtin.command: /usr/bin/tdnf -y clean all
4854

0 commit comments

Comments
 (0)