From d0263e65bcefb9224a673a5ef5ad72caac14b587 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 20 Jul 2021 10:56:33 +0000 Subject: [PATCH] Support setting docker registry credentials to the empty string The use case is that I want to set these credentials via extra vars like this: kayobe overcloud container image build test -e kolla_docker_registry_username=$HARBOR_REGISTRY_USER -e kolla_docker_registry_password=$HARBOR_REGISTRY_PASSWORD Supporting the empty string means that I don't need to use any conditional logic. Change-Id: Ie5c21597266c8e470994eba16f3c2ed2224d0dcb --- ansible/container-image-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/container-image-build.yml b/ansible/container-image-build.yml index 6d462909f..8946cb3b3 100644 --- a/ansible/container-image-build.yml +++ b/ansible/container-image-build.yml @@ -41,8 +41,9 @@ password: "{{ kolla_docker_registry_password }}" reauthorize: yes when: - - kolla_docker_registry_username is not none - - kolla_docker_registry_password is not none + # NOTE(wszumski): Switch to truthy filter when min ansible>=2.10.5 + - kolla_docker_registry_username not in [none, ""] + - kolla_docker_registry_password not in [none, ""] - name: Ensure Kolla container images are built shell: