fb8217c16a
Zuul 4.6.0 does not allow to set ansible_python_interpreter. [1] Instead, with the current Zuul and Ansible, this should be automatically set to the proper python. This patch is required to restore the jobs which are ignored otherwise. [2] [3] Additionally, this change avoids the use of Ansible's pip module because it tries to use setuptools from the ansible_python_interpreter first even if another executable is set. [1] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023291.html [2] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023326.html [3] http://lists.openstack.org/pipermail/openstack-discuss/2021-June/023321.html Change-Id: Ib74eecd46617af51e23a3ccad664767b1bf6e04f
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
---
|
|
- hosts: all
|
|
vars:
|
|
# NOTE(yoctozepto): We need Docker SDK, the best source is Kolla venv.
|
|
ansible_python_interpreter: "{{ virtualenv_path }}/bin/python"
|
|
tasks:
|
|
- name: List all containers
|
|
docker_host_info:
|
|
images: yes
|
|
images_filters:
|
|
reference: "{{ kolla_namespace }}/*"
|
|
register: docker_host_info
|
|
|
|
- block:
|
|
- name: Login to Dockerhub
|
|
docker_login:
|
|
username: "{{ kolla_dockerhub_creds.user | trim }}"
|
|
password: "{{ kolla_dockerhub_creds.password | trim }}"
|
|
|
|
- name: Push built container images
|
|
docker_image:
|
|
name: "{{ item.RepoTags.0 }}"
|
|
push: yes
|
|
loop: "{{ docker_host_info.images }}"
|
|
when: kolla_registry == 'dockerhub'
|
|
|
|
- block:
|
|
- name: Login to quay.io
|
|
docker_login:
|
|
registry: quay.io
|
|
username: "{{ kolla_quay_io_creds.username | trim }}"
|
|
password: "{{ kolla_quay_io_creds.password | trim }}"
|
|
|
|
- name: Push built container images
|
|
docker_image:
|
|
name: "{{ item.RepoTags.0 }}"
|
|
push: yes
|
|
repository: "quay.io/{{ item.RepoTags.0 }}"
|
|
source: local
|
|
loop: "{{ docker_host_info.images }}"
|
|
when: kolla_registry == 'quay.io'
|