Skip to content

Commit 266ec4c

Browse files
toskydanpawlik
authored andcommitted
adoption, container login: consider also the variables already used
There are already some variables used for to specify the container registry credentials - just use them. As fallback for now, they may become the only variables considered. (Those variables should become a list of dictionaries, not just direct values, but that's a different story.)
1 parent e81274d commit 266ec4c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

roles/adoption_osp_deploy/tasks/login_registries.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@
4141
msg: "{{ _current_rh_release.stdout }}"
4242

4343
- name: Login in container registry
44+
vars:
45+
_container_user: "{{ cifmw_adoption_osp_deploy_container_user|default(cifmw_registry_token.credentials.username, True) }}"
46+
_container_password: "{{ cifmw_adoption_osp_deploy_container_password|default(cifmw_registry_token.credentials.password, True) }}"
47+
_container_registry: "{{ cifmw_adoption_osp_deploy_container_registry|default(cifmw_registry_token_registry_url, True) }}"
4448
when:
45-
- cifmw_adoption_osp_deploy_container_user is defined
46-
- cifmw_adoption_osp_deploy_container_password is defined
47-
- cifmw_adoption_osp_deploy_container_registry is defined
49+
- _container_user is defined
50+
- _container_password is defined
51+
- _container_registry is defined
4852
block:
4953
- name: Install podman for container registry login
5054
become: true
@@ -57,9 +61,9 @@
5761
no_log: true
5862
ansible.builtin.command: >
5963
podman login
60-
--username "{{ cifmw_adoption_osp_deploy_container_user }}"
61-
--password "{{ cifmw_adoption_osp_deploy_container_password }}"
62-
{{ cifmw_adoption_osp_deploy_container_registry }}
64+
--username "{{ _container_user }}"
65+
--password "{{ _container_password }}"
66+
{{ _container_registry }}
6367
loop:
6468
- zuul
6569
- root

0 commit comments

Comments
 (0)