Skip to content

Commit ec4519d

Browse files
committed
Using registry credentials is now mandatory.
From now on, to have working deployment, you'll need credentials for the registry with images for ceph and tripleo.
1 parent c14f392 commit ec4519d

File tree

7 files changed

+52
-19
lines changed

7 files changed

+52
-19
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ At present the deployment depends on a valid DHCP source for the external interf
3333

3434
All other requirements should be configured automatically by Ansible. Note that `dev-install` does require root access (or passwordless sudo) on the machine it is invoked from to install certificate management tools (simpleca) in addition to the remote host.
3535

36+
## Defining registry
37+
38+
Recently, there were changed way for accessing RedHat registry. Now it's mandatory to provide credentials to `local-override.yaml` file in a form of a list:
39+
40+
```yaml
41+
registers:
42+
- name: registry1.url
43+
username: joe
44+
password: secret
45+
- name: registry2.url
46+
username: alice
47+
password: supersecret
48+
```
49+
50+
RedHat registry, is expected to be the first one.
51+
3652
## Running dev-install
3753
3854
`dev-install` is invoked using its `Makefile`. The simplest invocation is:

playbooks/install_stack.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@
151151
become_user: root
152152
ansible.builtin.command: update-ca-trust extract
153153

154+
- name: Login into registries
155+
become: true
156+
become_user: root
157+
when:
158+
- registers is defined
159+
- (registers | length) > 0
160+
block:
161+
- name: Login to registry
162+
containers.podman.podman_login:
163+
username: "{{ item.username | ansible.builtin.mandatory }}"
164+
password: "{{ item.password | ansible.builtin.mandatory }}"
165+
registry: "{{ item.name }}"
166+
loop: "{{ registers }}"
167+
154168
- name: Install the tripleo client
155169
ansible.builtin.yum:
156170
name: python3-tripleoclient

playbooks/prepare_stack.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
- hosts: standalone
43
become: true
54
become_user: stack

playbooks/roles/ceph/tasks/main.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@
1616
containers_prep: "{{ ansible_env.HOME }}/containers-prepare-parameters.yaml"
1717
deployed_ceph: "{{ ansible_env.HOME }}/deployed_ceph.yaml"
1818

19-
- name: Login into registry.redhat.io
20-
become: true
21-
become_user: root
22-
when:
23-
- rhsm_enabled
24-
block:
25-
- name: Login to registry.redhat.io
26-
containers.podman.podman_login:
27-
username: "{{ redhat_registry_credentials.username | ansible.builtin.mandatory }}"
28-
password: "{{ redhat_registry_credentials.password | ansible.builtin.mandatory }}"
29-
registry: registry.redhat.io
30-
3119
- name: Configure Storage Network
3220
ansible.builtin.include_tasks: storage-network.yml
3321
vars:

playbooks/roles/operators/tasks/main.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
---
22
# Install tripleo-operator in current user environment
33
# and provide plugins and roles to local ansible env.
4+
- name: Ensure there are credentials for accessing registry
5+
tags:
6+
- always
7+
- lab
8+
ansible.builtin.assert:
9+
that:
10+
- registers is defined
11+
- (registers|length) > 0
12+
- registers.0.name is defined
13+
- registers.0.username is defined
14+
- registers.0.password is defined
15+
msg: "It is expected to have defined at least one registry"
16+
417
- name: Ensure we have ~/.ansible
518
tags:
619
- always

playbooks/templates/standalone_parameters.yaml.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ parameter_defaults:
144144
NtpServer: {{ ntp_server }}
145145
{% endif %}
146146
ContainerImageRegistryCredentials:
147-
registry.redhat.io:
148-
{{ redhat_registry_credentials.username | ansible.builtin.mandatory | ansible.builtin.quote }}: {{ redhat_registry_credentials.password | ansible.builtin.mandatory | ansible.builtin.quote }}
147+
# assume first registry
148+
{{ registers.0.name | ansible.builtin.mandatory}}:
149+
{{ registers.0.username | ansible.builtin.mandatory | ansible.builtin.quote }}: {{ registers.0.password | ansible.builtin.mandatory | ansible.builtin.quote }}
149150
ContainerImageRegistryLogin: true
150151
{% endif %}
151152
{% if ssl_enabled %}

playbooks/vars/defaults.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,12 @@ rhsm_container_tools_version: '3.0'
229229
# Note: to install 16.1 on RHEL 8.2, you need virt_release set to "8.2"
230230
# For OSP 16.2 on RHEL 8.4, you need "av".
231231
virt_release: av
232-
# Red Hat Registry credentials have to be set when deploying OSP on RHEL
233-
# redhat_registry_credentials:
234-
# username: joe
235-
# password: secrete
232+
# Red Hat Registry credentials have to be set when deploying OSP on RHEL. Main
233+
# registry, and all additional one should be defined in a list:
234+
# registers:
235+
# - name: registry.url
236+
# username: joe
237+
# password: secret
236238

237239
# Edge parameters
238240
# The central site must be named "central", otherwise for other AZs it's up to the user.

0 commit comments

Comments
 (0)