Skip to content

Commit 487eb2d

Browse files
[patch] Revert due to dict key issue
1 parent 67f5823 commit 487eb2d

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

ibm/mas_devops/roles/ocp_idms/tasks/update-pull-secret-dev.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
- name: "update-pull-secret-dev : Set new secret content"
77
vars:
88
artifactoryAuthB64: "{{ artifactory_auth | b64encode }}"
9+
content:
10+
- "{\"auths\":{\"{{ fvt_image_registry }}\":{\"username\":\"{{ artifactory_username }}\",\"password\":\"{{ artifactory_token }}\",\"email\":\"{{ artifactory_username }}\",\"auth\":\"{{ artifactoryAuthB64 }}\"}"
11+
- "}"
12+
- "}"
913
set_fact:
10-
new_secret_dev:
11-
auths:
12-
"{{ fvt_image_registry }}":
13-
username: "{{ artifactory_username }}"
14-
password: "{{ artifactory_token }}"
15-
email: "{{ artifactory_username }}"
16-
auth: "{{ artifactoryAuthB64 }}"
14+
new_secret_dev: "{{ content | join('') }}"
1715
no_log: true
1816

1917
# 1.2 Find the existing secret, and we are going to modify it rather than replace
@@ -38,9 +36,18 @@
3836
no_log: true
3937

4038
# 1.3 Append our new credentials to the secret
41-
- name: "update-pull-secret-dev : Combine new secret content"
39+
- name: "update-pull-secret-dev : Convert new secret to dict"
4240
set_fact:
43-
new_secret_string: '{{ secret_string | combine( new_secret_dev, recursive=True) }}'
41+
new_secret_dev_dict: "{{ new_secret_dev | from_json }}"
42+
no_log: true
43+
44+
- name: "update-pull-secret-dev : Debug registry URL"
45+
debug:
46+
msg: "Adding credentials for registry: {{ fvt_image_registry }}"
47+
48+
- name: "update-pull-secret-dev : Merge secrets"
49+
set_fact:
50+
new_secret_string: "{{ secret_string | combine(new_secret_dev_dict, recursive=True, list_merge='append') }}"
4451
no_log: true
4552

4653
# 1.4. Overwrite the secret

ibm/mas_devops/roles/ocp_idms/tasks/update-pull-secret.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
- name: "update-pull-secret : Set new secret content"
77
vars:
88
registryAuthB64: "{{ registry_auth | b64encode }}"
9+
content:
10+
- "{\"auths\":{\"{{ registry_private_url }}\":{\"username\":\"{{ registry_username }}\",\"password\":\"{{ registry_password }}\",\"email\":\"{{ registry_username }}\",\"auth\":\"{{ registryAuthB64 }}\"}"
11+
- "}"
12+
- "}"
913
set_fact:
10-
new_secret:
11-
auths:
12-
"{{ registry_private_url }}":
13-
username: "{{ registry_username }}"
14-
password: "{{ registry_password }}"
15-
email: "{{ registry_username }}"
16-
auth: "{{ registryAuthB64 }}"
14+
new_secret: "{{ content | join('') }}"
1715
no_log: true
1816

1917
# 1.2 Find the existing secret, and we are going to modify it rather than replace
@@ -38,9 +36,18 @@
3836
no_log: true
3937

4038
# 1.3 Append our new credentials to the secret
41-
- name: "update-pull-secret : Combine new secret content"
39+
- name: "update-pull-secret : Convert new secret to dict"
4240
set_fact:
43-
new_secret_string: '{{ secret_string | combine(new_secret, recursive=True) }}'
41+
new_secret_dict: "{{ new_secret | from_json }}"
42+
no_log: true
43+
44+
- name: "update-pull-secret : Debug registry URL"
45+
debug:
46+
msg: "Adding credentials for registry: {{ registry_private_url }}"
47+
48+
- name: "update-pull-secret : Merge secrets"
49+
set_fact:
50+
new_secret_string: "{{ secret_string | combine(new_secret_dict, recursive=True, list_merge='append') }}"
4451
no_log: true
4552

4653
# 1.4. Overwrite the secret

0 commit comments

Comments
 (0)