aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/playbooks/post.yml16
-rw-r--r--tests/playbooks/pre.yml3
-rw-r--r--tests/playbooks/publish.yml31
-rw-r--r--tests/playbooks/run.yml19
-rw-r--r--tests/vars/zuul.yml6
5 files changed, 46 insertions, 29 deletions
diff --git a/tests/playbooks/post.yml b/tests/playbooks/post.yml
index 7245b7ba8..030663810 100644
--- a/tests/playbooks/post.yml
+++ b/tests/playbooks/post.yml
@@ -1,13 +1,16 @@
---
-- hosts: all
+- name: Zuul post
+ hosts: all
tasks:
- name: Dump host info to logs
- command: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tools/dump_info.sh"
+ ansible.builtin.command: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tools/dump_info.sh"
args:
chdir: "{{ kolla_logs_dir }}"
+ changed_when: true
- name: Collect various info to logs
- shell:
+ changed_when: true
+ ansible.builtin.shell:
cmd: |
set +o errexit
set -o xtrace
@@ -63,7 +66,9 @@
ps -eo user,pid,ppid,lwp,%cpu,%mem,size,rss,cmd > ps.txt
# docker related information
- (sudo {{ container_engine }} info && sudo {{ container_engine }} system df && sudo {{ container_engine }} system df -v) > {{ container_engine }}-info.txt
+ (sudo {{ container_engine }} info && \
+ sudo {{ container_engine }} system df && \
+ sudo {{ container_engine }} system df -v) > {{ container_engine }}-info.txt
sudo cp -r /etc/kolla kolla_configs
@@ -71,6 +76,7 @@
sudo chown -R {{ ansible_user_id }}: .
# Parse build logs and extract pkg install info
- {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/files/process_build_logs.py -l build -b {{ base_distro }} > packages-info.txt
+ {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/files/process_build_logs.py \
+ -l build -b {{ base_distro }} > packages-info.txt
executable: /bin/bash
chdir: "{{ kolla_logs_dir }}"
diff --git a/tests/playbooks/pre.yml b/tests/playbooks/pre.yml
index 7ebb66031..773370967 100644
--- a/tests/playbooks/pre.yml
+++ b/tests/playbooks/pre.yml
@@ -1,5 +1,6 @@
---
-- hosts: all
+- name: Zuul pre
+ hosts: all
vars_files:
- ../vars/zuul.yml
roles:
diff --git a/tests/playbooks/publish.yml b/tests/playbooks/publish.yml
index 76352d299..fd9124cd5 100644
--- a/tests/playbooks/publish.yml
+++ b/tests/playbooks/publish.yml
@@ -1,44 +1,48 @@
---
-- hosts: all
+- name: Zuul publish
+ 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
+ community.docker.docker_host_info:
+ images: true
images_filters:
reference: "{{ kolla_namespace }}/*"
register: docker_host_info
- - block:
+ - name: Publish to Dockerhub
+ when: kolla_registry == 'dockerhub'
+ block:
- name: Login to Dockerhub
- docker_login:
+ community.docker.docker_login:
username: "{{ kolla_dockerhub_credentials.username | trim }}"
password: "{{ kolla_dockerhub_credentials.password | trim }}"
- name: Push built container images
- docker_image:
+ community.docker.docker_image:
name: "{{ item.RepoTags.0 }}"
- push: yes
+ push: true
source: local
loop: "{{ docker_host_info.images }}"
register: push_status
until: push_status.failed is false
retries: 5
- when: kolla_registry == 'dockerhub'
- - block:
+ - name: Publish to quay.io
+ when: kolla_registry == 'quay.io'
+ block:
- name: Login to quay.io
- docker_login:
+ community.docker.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:
+ community.docker.docker_image:
name: "{{ item.RepoTags.0 }}"
- push: yes
+ push: true
repository: "quay.io/{{ item.RepoTags.0 }}"
source: local
loop: "{{ docker_host_info.images }}"
@@ -47,7 +51,7 @@
retries: 5
- name: Ensure repository visibility is public
- uri:
+ ansible.builtin.uri:
url: "https://quay.io/api/v1/repository/{{ item.RepoTags.0 }}/changevisibility"
method: POST
headers:
@@ -55,4 +59,3 @@
body: '{"visibility": "public"}'
body_format: json
loop: "{{ docker_host_info.images }}"
- when: kolla_registry == 'quay.io'
diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml
index 238b2f7bd..c946343a5 100644
--- a/tests/playbooks/run.yml
+++ b/tests/playbooks/run.yml
@@ -1,5 +1,6 @@
---
-- hosts: all
+- name: Zuul run
+ hosts: all
vars_files:
- ../vars/zuul.yml
vars:
@@ -18,10 +19,10 @@
network_mode: host
tasks:
- name: Ensure /etc/kolla exists
- file:
+ ansible.builtin.file:
path: /etc/kolla
state: directory
- mode: 0777
+ mode: "0777"
become: true
- name: Use ubuntu/debian base image from mirror
@@ -29,7 +30,7 @@
kolla_mirror_config:
DEFAULT:
base_image: "quay.io/openstack.kolla/{{ base_distro }}"
- set_fact:
+ ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_mirror_config, recursive=True) }}"
when: base_distro in ['debian', 'ubuntu']
@@ -39,7 +40,7 @@
DEFAULT:
namespace: "{{ kolla_namespace }}"
tag: "{{ zuul.branch | basename }}-{{ base_distro }}-{{ base_distro_version }}{{ tag_suffix }}"
- set_fact:
+ ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_publisher_config, recursive=True) }}"
when:
- publisher
@@ -56,13 +57,15 @@
releaser-user:
uid: 56000
gid: 56000
- set_fact:
+ ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_build_external_docker_config, recursive=True) }}"
when:
- not publisher
- - import_role:
+ - name: Import kolla-build-config role
+ import_role:
name: kolla-build-config
- - import_role:
+ - name: Import kolla-build role
+ import_role:
name: kolla-build
diff --git a/tests/vars/zuul.yml b/tests/vars/zuul.yml
index 1c0c99e3d..e49f9d356 100644
--- a/tests/vars/zuul.yml
+++ b/tests/vars/zuul.yml
@@ -7,4 +7,8 @@ nodepool_cbs_centos_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/cbs.centos"
nodepool_docker_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/docker"
# NOTE(hrw): wheel cache goes over 80/443 not on 8080
-nodepool_wheel_mirror: "https://{{ zuul_site_mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ (ansible_os_family == 'Debian') | ternary(ansible_distribution_version, ansible_distribution_major_version) }}-{{ ansible_architecture | lower }}"
+nodepool_wheel_mirror: >-
+ https://{{ zuul_site_mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-
+ {{ (ansible_os_family == 'Debian') |
+ ternary(ansible_distribution_version, ansible_distribution_major_version) }}-
+ {{ ansible_architecture | lower }}