Skip to content

Commit 6c74a1e

Browse files
committed
repos now controlled by groups + possible during configure + guarded against cred leaks
1 parent 9c41725 commit 6c74a1e

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

ansible/bootstrap.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@
110110
policy: "{{ selinux_policy }}"
111111
register: sestatus
112112

113+
- hosts: dnf_repos
114+
become: yes
115+
tasks:
116+
- name: Check that creds won't be leaked to users
117+
ansible.builtin.assert:
118+
that: dnf_repos_password is undefined
119+
fail_msg: Passwords should not be templated into repofiles during configure, unset 'dnf_repos_password'
120+
when: appliances_mode == 'configure'
121+
- name: Replace system repos with pulp repos
122+
ansible.builtin.include_role:
123+
name: dnf_repos
124+
tasks_from: set_repos.yml
125+
when: ansible_distribution_major_version == "9" #TODO update role once RL8 config decided
126+
113127
# --- tasks after here require access to package repos ---
114128
- hosts: squid
115129
tags: squid

ansible/disable-repos.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- hosts: dnf_repos
2+
become: yes
3+
tasks:
4+
- name: Disable pulp repos
5+
ansible.builtin.include_role:
6+
name: dnf_repos
7+
tasks_from: disable_repos.yml
8+
when: ansible_distribution_major_version == "9" #TODO update role once RL8 config decided

ansible/fatimage.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@
2727
delegate_to: localhost
2828
when: appliances_mode != 'configure'
2929

30-
- hosts: dnf_repos
31-
become: yes
32-
tasks:
33-
- name: Replace system repos with pulp repos
34-
ansible.builtin.include_role:
35-
name: dnf_repos
36-
tasks_from: set_repos.yml
37-
when: appliances_mode != 'configure' and ansible_distribution_major_version == "9" #TODO update role once RL8 config decided
38-
3930
- import_playbook: bootstrap.yml
4031

4132
- name: Run post-bootstrap.yml hook
@@ -229,14 +220,7 @@
229220
import_role:
230221
name: doca
231222

232-
- hosts: dnf_repos
233-
become: yes
234-
tasks:
235-
- name: Disable pulp repos
236-
ansible.builtin.include_role:
237-
name: dnf_repos
238-
tasks_from: disable_repos.yml
239-
when: appliances_mode != 'configure' and ansible_distribution_major_version == "9" #TODO update role once RL8 config decided
223+
- import_playbook: disable_repos.yml
240224

241225
- name: Run post.yml hook
242226
vars:

ansible/site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- import_playbook: slurm.yml
2828
- import_playbook: portal.yml
2929
- import_playbook: monitoring.yml
30+
- import_playbook: disable_repos.yml
3031

3132
- name: Run post.yml hook
3233
vars:

environments/common/inventory/groups

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ freeipa_client
147147

148148
[dnf_repos:children]
149149
# Hosts to replace system repos with Pulp repos
150+
# Warning: when using Ark directly rather than a local Pulp server, adding hosts other than `builder` will leak Ark creds to users
150151
builder
151152

152153
[pulp]
153154
# Add builder to this group to enable automatically syncing of pulp during image build
154-
# Warning: when using Ark directly rather than a local Pulp server, adding hosts other than `builder` risks leaking Ark creds

0 commit comments

Comments
 (0)