diff --git a/ansible/container-image-build.yml b/ansible/container-image-build.yml index a790201b12b12f4327e3fff15c58acf61d9347b5..9a6674052e72837f922552db37a8be88529fad26 100644 --- a/ansible/container-image-build.yml +++ b/ansible/container-image-build.yml @@ -40,9 +40,8 @@ password: "{{ kolla_docker_registry_password }}" reauthorize: yes when: - # 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, ""] + - kolla_docker_registry_username is truthy + - kolla_docker_registry_password is truthy - name: Ensure Kolla container images are built shell: diff --git a/ansible/roles/deploy-containers/tasks/main.yml b/ansible/roles/deploy-containers/tasks/main.yml index 9d3e1520949bc2fc94955a0d891b5589b1b7e06e..c1ec533a3f4f35273e6499d3caf74ab8cb107bf0 100644 --- a/ansible/roles/deploy-containers/tasks/main.yml +++ b/ansible/roles/deploy-containers/tasks/main.yml @@ -1,4 +1,14 @@ --- +- name: Login to docker registry + docker_login: + registry_url: "{{ kolla_docker_registry or omit }}" + username: "{{ kolla_docker_registry_username }}" + password: "{{ kolla_docker_registry_password }}" + reauthorize: yes + when: + - kolla_docker_registry_username is truthy + - kolla_docker_registry_password is truthy + - name: Deploy containers (loop) include_tasks: deploy.yml vars: diff --git a/releasenotes/notes/kayobe_docker_login-495a424c2da479a7.yaml b/releasenotes/notes/kayobe_docker_login-495a424c2da479a7.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d1c2e2bb5ecb6b40335b02c3a3cefc39bf0e0330 --- /dev/null +++ b/releasenotes/notes/kayobe_docker_login-495a424c2da479a7.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed issue of seed containers being unable to use password + protected registry by adding docker login function to kayobe + deploy-containers role.