Add second fact to ensure type safty
The logins json can be both a hash and a string, depending on how it is being set by the deployer. To ensure that we're able to cover both cases this change will test the initial data type and react accordingly. Change-Id: I443bc36ca8808e1547da37f207b011031120067f Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
parent
2317c48e70
commit
51469aab2e
@ -168,6 +168,14 @@ outputs:
|
||||
set_fact:
|
||||
container_registry_logins: "{{ container_registry_logins_json | from_json }}"
|
||||
when:
|
||||
- container_registry_logins_json is string
|
||||
- container_registry_login | bool
|
||||
- (container_registry_logins_json | length) > 0
|
||||
- name: Set registry logins
|
||||
set_fact:
|
||||
container_registry_logins: "{{ container_registry_logins_json }}"
|
||||
when:
|
||||
- container_registry_logins_json is mapping
|
||||
- container_registry_login | bool
|
||||
- (container_registry_logins_json | length) > 0
|
||||
- include_role:
|
||||
|
@ -90,6 +90,15 @@ outputs:
|
||||
set_fact:
|
||||
container_registry_logins: "{{ container_registry_logins_json | from_json }}"
|
||||
when:
|
||||
- container_registry_logins_json is string
|
||||
- container_registry_login | bool
|
||||
- (container_registry_logins_json | length) > 0
|
||||
|
||||
- name: Set registry logins
|
||||
set_fact:
|
||||
container_registry_logins: "{{ container_registry_logins_json }}"
|
||||
when:
|
||||
- container_registry_logins_json is mapping
|
||||
- container_registry_login | bool
|
||||
- (container_registry_logins_json | length) > 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user