From 589cccb0559e92bbde41730b4cb108db8dfdd1c6 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 20 Nov 2024 14:12:55 -0800 Subject: [PATCH] Fix dockerhub check in use-docker-mirror role We were checking if dockerhub is a valid key in the zuul_site_mirror_info/mirror_info dictionaries but did so without quoting dockerhub as a string. This meant ansible tried to look up dockerhub as a variable producing this error: The conditional check 'dockerhub is in zuul_site_mirror_info' failed. The error was: error while evaluating conditional (dockerhub is in zuul_site_mirror_info): 'dockerhub' is undefined. 'dockerhub' is undefined Fix this by quoting dockerhub so that we lookup the string as a key instead of a variable. Change-Id: Ie869b9b52fd0a5b70fc07548ce449937ed2c9589 --- roles/use-docker-mirror/tasks/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/use-docker-mirror/tasks/main.yaml b/roles/use-docker-mirror/tasks/main.yaml index 06d64f93d..761abd2f8 100644 --- a/roles/use-docker-mirror/tasks/main.yaml +++ b/roles/use-docker-mirror/tasks/main.yaml @@ -2,7 +2,7 @@ when: - docker_mirror is not defined - mirror_info is defined - - dockerhub is in mirror_info + - "'dockerhub' is in mirror_info" set_fact: docker_mirror: mirror_info.dockerhub.url @@ -10,7 +10,7 @@ when: - docker_mirror is not defined - zuul_site_mirror_info is defined - - dockerhub is in zuul_site_mirror_info + - "'dockerhub' is in zuul_site_mirror_info" set_fact: docker_mirror: zuul_site_mirror_info.dockerhub.url