Fix variables interpolation for included roles
w/a https://github.com/ansible/ansible/issues/42621 Include ansible-role-container-registry roles/tasks with handlers having the right variables scope. Closes-Bug: #1781198 Change-Id: I26cc07aa05912c3e84d59003686eae210e924a16 Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
parent
bb99c7a9b6
commit
5a70af7bc3
|
@ -60,14 +60,15 @@ outputs:
|
|||
deploy_steps_tasks:
|
||||
- name: Install, Configure and Run Docker Distribution
|
||||
when: step|int == 1
|
||||
vars:
|
||||
container_registry_host:
|
||||
if:
|
||||
- local_container_registry_is_empty
|
||||
- {get_param: [EndpointMap, DockerRegistryInternal, host]}
|
||||
- {get_param: LocalContainerRegistry}
|
||||
container_registry_port: {get_param: [EndpointMap, DockerRegistryInternal, port]}
|
||||
block:
|
||||
# NOTE(bogdando): w/a https://github.com/ansible/ansible/issues/42621
|
||||
- set_fact:
|
||||
container_registry_host:
|
||||
if:
|
||||
- local_container_registry_is_empty
|
||||
- {get_param: [EndpointMap, DockerRegistryInternal, host]}
|
||||
- {get_param: LocalContainerRegistry}
|
||||
container_registry_port: {get_param: [EndpointMap, DockerRegistryInternal, port]}
|
||||
- include_role:
|
||||
name: container-registry
|
||||
tasks_from: docker-distribution
|
||||
|
|
|
@ -84,23 +84,24 @@ outputs:
|
|||
deploy_steps_tasks:
|
||||
- name: Install, Configure and Run Docker
|
||||
when: step|int == 1
|
||||
vars: &docker_vars
|
||||
container_registry_debug:
|
||||
if:
|
||||
- service_debug_unset
|
||||
- {get_param: Debug }
|
||||
- {get_param: DockerDebug}
|
||||
container_registry_deployment_user: {get_param: DeploymentUser}
|
||||
container_registry_docker_options: {get_param: DockerOptions}
|
||||
container_registry_additional_sockets: {get_param: DockerAdditionalSockets}
|
||||
container_registry_insecure_registries:
|
||||
if:
|
||||
- insecure_registry_is_empty
|
||||
- []
|
||||
- {get_param: DockerInsecureRegistryAddress}
|
||||
container_registry_mirror: {get_param: DockerRegistryMirror}
|
||||
container_registry_network_options: {get_param: DockerNetworkOptions}
|
||||
block:
|
||||
# NOTE(bogdando): w/a https://github.com/ansible/ansible/issues/42621
|
||||
- set_fact: &docker_vars
|
||||
container_registry_debug:
|
||||
if:
|
||||
- service_debug_unset
|
||||
- {get_param: Debug }
|
||||
- {get_param: DockerDebug}
|
||||
container_registry_deployment_user: {get_param: DeploymentUser}
|
||||
container_registry_docker_options: {get_param: DockerOptions}
|
||||
container_registry_additional_sockets: {get_param: DockerAdditionalSockets}
|
||||
container_registry_insecure_registries:
|
||||
if:
|
||||
- insecure_registry_is_empty
|
||||
- []
|
||||
- {get_param: DockerInsecureRegistryAddress}
|
||||
container_registry_mirror: {get_param: DockerRegistryMirror}
|
||||
container_registry_network_options: {get_param: DockerNetworkOptions}
|
||||
- include_role:
|
||||
name: container-registry
|
||||
tasks_from: docker
|
||||
|
@ -116,8 +117,8 @@ outputs:
|
|||
update_tasks:
|
||||
- name: Restart Docker when needed
|
||||
when: step|int == 2
|
||||
vars: *docker_vars
|
||||
block:
|
||||
- set_fact: *docker_vars
|
||||
- include_role:
|
||||
name: container-registry
|
||||
tasks_from: docker-update
|
||||
|
|
Loading…
Reference in New Issue