DRY out Zuul job configuration

Adds a new abstract parent job for the following kayobe deploy jobs:

kayobe-overcloud-centos
kayobe-overcloud-upgrade-centos
kayobe-seed-centos
kayobe-seed-upgrade-centos

This parent includes commonly used variables, and pre-run and post-run
playbooks for preparing and executing diagnostics, plus other
initialisation.

Change-Id: I9ab89fbc49bb32d86af56d50ec3914740e65d0f8
This commit is contained in:
Mark Goddard 2019-03-28 19:08:53 +00:00 committed by Will Szumski
parent 61d957f2cb
commit ca3b5a7701
14 changed files with 47 additions and 190 deletions

View File

@ -4,5 +4,6 @@
- role: kayobe-diagnostics - role: kayobe-diagnostics
kayobe_diagnostics_phase: "post" kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs" kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}" kayobe_diagnostics_config_dir: "{{ kayobe_config_src_dir }}"
kayobe_diagnostics_previous_config_dir: "{{ previous_kayobe_config_src_dir }}"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -0,0 +1,17 @@
---
- hosts: primary
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "pre"
kayobe_diagnostics_log_dir: "{{ logs_dir }}"
- role: kayobe-ci-prep
tasks:
# NOTE(mgoddard): Copying upper constraints to somewhere accessible by both
# the zuul and stack users.
- name: Ensure upper-contraints.txt exists
copy:
src: "{{ requirements_src_dir }}/upper-constraints.txt"
dest: "/tmp"
mode: 0644
remote_src: true

View File

@ -1,27 +1,8 @@
--- ---
- hosts: primary - hosts: primary
vars:
logs_dir: "/tmp/logs"
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
environment: environment:
KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}"
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "pre"
kayobe_diagnostics_log_dir: "{{ logs_dir }}"
- role: kayobe-ci-prep
tasks: tasks:
# NOTE(mgoddard): Copying upper constraints to somewhere accessible by both
# the zuul and stack users.
- name: Ensure upper-contraints.txt exists
copy:
src: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir ~ '/upper-constraints.txt' }}"
dest: "/tmp"
mode: 0644
remote_src: true
# NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes # NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes
# precedence over the standard config files. # precedence over the standard config files.
- name: Ensure kayobe-config override config file exists - name: Ensure kayobe-config override config file exists

View File

@ -1,10 +1,5 @@
--- ---
- hosts: primary - hosts: primary
vars:
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
logs_dir: "/tmp/logs"
tenks_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/tenks'].src_dir }}"
environment: environment:
KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}"
tasks: tasks:

View File

@ -1,9 +0,0 @@
---
- hosts: all
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
kayobe_diagnostics_previous_config_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -1,27 +1,6 @@
--- ---
- hosts: primary - hosts: primary
vars:
logs_dir: "/tmp/logs"
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
previous_kayobe_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe' }}"
previous_kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "pre"
kayobe_diagnostics_log_dir: "{{ logs_dir }}"
- role: kayobe-ci-prep
tasks: tasks:
# NOTE(mgoddard): Copying upper constraints to somewhere accessible by both
# the zuul and stack users.
- name: Ensure upper-contraints.txt exists
copy:
src: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir ~ '/upper-constraints.txt' }}"
dest: "/tmp"
mode: 0644
remote_src: true
- name: Ensure previous kayobe directory exists - name: Ensure previous kayobe directory exists
file: file:
path: "{{ previous_kayobe_src_dir }}" path: "{{ previous_kayobe_src_dir }}"

View File

@ -1,12 +1,5 @@
--- ---
- hosts: primary - hosts: primary
vars:
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
previous_kayobe_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe' }}"
previous_kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
logs_dir: "/tmp/logs"
tenks_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/tenks'].src_dir }}"
tasks: tasks:
# Install the previous release of Kayobe, and use it to deploy a control # Install the previous release of Kayobe, and use it to deploy a control

View File

@ -1,8 +0,0 @@
---
- hosts: all
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -1,27 +1,8 @@
--- ---
- hosts: primary - hosts: primary
vars:
logs_dir: "/tmp/logs"
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
environment: environment:
KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}"
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "pre"
kayobe_diagnostics_log_dir: "{{ logs_dir }}"
- role: kayobe-ci-prep
tasks: tasks:
# NOTE(mgoddard): Copying upper constraints to somewhere accessible by both
# the zuul and stack users.
- name: Ensure upper-contraints.txt exists
copy:
src: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir ~ '/upper-constraints.txt' }}"
dest: "/tmp"
mode: 0644
remote_src: true
# NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes # NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes
# precedence over the standard config files. # precedence over the standard config files.
- name: Ensure kayobe-config override config file exists - name: Ensure kayobe-config override config file exists

View File

@ -1,9 +1,5 @@
--- ---
- hosts: primary - hosts: primary
vars:
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
logs_dir: "/tmp/logs"
environment: environment:
KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}"
# Don't provision a seed VM - use the Zuul VM as the seed host. # Don't provision a seed VM - use the Zuul VM as the seed host.

View File

@ -1,9 +0,0 @@
---
- hosts: all
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "post"
kayobe_diagnostics_log_dir: "/tmp/logs"
kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
kayobe_diagnostics_previous_config_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"

View File

@ -1,25 +1,6 @@
--- ---
- hosts: primary - hosts: primary
vars:
logs_dir: "/tmp/logs"
previous_kayobe_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe' }}"
previous_kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
roles:
- role: kayobe-diagnostics
kayobe_diagnostics_phase: "pre"
kayobe_diagnostics_log_dir: "{{ logs_dir }}"
- role: kayobe-ci-prep
tasks: tasks:
# NOTE(mgoddard): Copying upper constraints to somewhere accessible by both
# the zuul and stack users.
- name: Ensure upper-contraints.txt exists
copy:
src: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir ~ '/upper-constraints.txt' }}"
dest: "/tmp"
mode: 0644
remote_src: true
- name: Ensure previous kayobe directory exists - name: Ensure previous kayobe directory exists
file: file:
path: "{{ previous_kayobe_src_dir }}" path: "{{ previous_kayobe_src_dir }}"

View File

@ -1,11 +1,5 @@
--- ---
- hosts: primary - hosts: primary
vars:
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
previous_kayobe_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe' }}"
previous_kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
logs_dir: "/tmp/logs"
tasks: tasks:
# Install the previous release of Kayobe, and use it to deploy a control # Install the previous release of Kayobe, and use it to deploy a control

View File

@ -47,16 +47,12 @@
- ^setup.cfg$ - ^setup.cfg$
- job: - job:
name: kayobe-overcloud-base name: kayobe-base
description: | description: |
Base job for testing overcloud deployment. Base job for all deployment jobs.
pre-run: playbooks/kayobe-base/pre.yml
Configures the primary VM as an overcloud controller. post-run: playbooks/kayobe-base/post.yml
pre-run: playbooks/kayobe-overcloud-base/pre.yml
run: playbooks/kayobe-overcloud-base/run.yml
post-run: playbooks/kayobe-overcloud-base/post.yml
attempts: 1 attempts: 1
timeout: 7200
required-projects: required-projects:
# Include kayobe to ensure other projects can use this job. # Include kayobe to ensure other projects can use this job.
- name: x/kayobe - name: x/kayobe
@ -72,6 +68,27 @@
- ^setup.cfg$ - ^setup.cfg$
- ^tools/.*$ - ^tools/.*$
- ^tox.ini$ - ^tox.ini$
vars:
# Name of the release to upgrade from for upgrade jobs.
previous_release: rocky
logs_dir: "/tmp/logs"
kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe'].src_dir }}"
kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/x/kayobe-config-dev'].src_dir }}"
previous_kayobe_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe' }}"
previous_kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/previous/kayobe-config' }}"
requirements_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/requirements'].src_dir }}"
tenks_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/tenks'].src_dir }}"
- job:
name: kayobe-overcloud-base
parent: kayobe-base
description: |
Base job for testing overcloud deployment.
Configures the primary VM as an overcloud controller.
pre-run: playbooks/kayobe-overcloud-base/pre.yml
run: playbooks/kayobe-overcloud-base/run.yml
timeout: 7200
- job: - job:
name: kayobe-overcloud-centos name: kayobe-overcloud-centos
@ -80,6 +97,7 @@
- job: - job:
name: kayobe-overcloud-upgrade-base name: kayobe-overcloud-upgrade-base
parent: kayobe-base
description: | description: |
Base job for testing overcloud upgrades. Base job for testing overcloud upgrades.
@ -87,27 +105,7 @@
OpenStack release, and upgrades it to the current release. OpenStack release, and upgrades it to the current release.
pre-run: playbooks/kayobe-overcloud-upgrade-base/pre.yml pre-run: playbooks/kayobe-overcloud-upgrade-base/pre.yml
run: playbooks/kayobe-overcloud-upgrade-base/run.yml run: playbooks/kayobe-overcloud-upgrade-base/run.yml
post-run: playbooks/kayobe-overcloud-upgrade-base/post.yml
attempts: 1
timeout: 9000 timeout: 9000
required-projects:
# Include kayobe to ensure other projects can use this job.
- name: x/kayobe
- name: x/kayobe-config-dev
- name: openstack/kolla
- name: openstack/kolla-ansible
- name: openstack/requirements
- name: openstack/tenks
vars:
# Name of the release to upgrade from.
previous_release: rocky
irrelevant-files:
- ^.*\.rst$
- ^doc/.*
- ^releasenotes/.*
- ^setup.cfg$
- ^tools/.*$
- ^tox.ini$
- job: - job:
name: kayobe-overcloud-upgrade-centos name: kayobe-overcloud-upgrade-centos
@ -116,29 +114,14 @@
- job: - job:
name: kayobe-seed-base name: kayobe-seed-base
parent: kayobe-base
description: | description: |
Base job for testing seed deployment. Base job for testing seed deployment.
Configures the primary VM as a seed. Configures the primary VM as a seed.
pre-run: playbooks/kayobe-seed-base/pre.yml pre-run: playbooks/kayobe-seed-base/pre.yml
run: playbooks/kayobe-seed-base/run.yml run: playbooks/kayobe-seed-base/run.yml
post-run: playbooks/kayobe-seed-base/post.yml
attempts: 1
timeout: 5400 timeout: 5400
required-projects:
# Include kayobe to ensure other projects can use this job.
- name: x/kayobe
- name: x/kayobe-config-dev
- name: openstack/kolla
- name: openstack/kolla-ansible
- name: openstack/requirements
irrelevant-files:
- ^.*\.rst$
- ^doc/.*
- ^releasenotes/.*
- ^setup.cfg$
- ^tools/.*$
- ^tox.ini$
- job: - job:
name: kayobe-seed-centos name: kayobe-seed-centos
@ -147,6 +130,7 @@
- job: - job:
name: kayobe-seed-upgrade-base name: kayobe-seed-upgrade-base
parent: kayobe-base
description: | description: |
Base job for testing seed upgrades. Base job for testing seed upgrades.
@ -154,26 +138,7 @@
and upgrades it to the current release. and upgrades it to the current release.
pre-run: playbooks/kayobe-seed-upgrade-base/pre.yml pre-run: playbooks/kayobe-seed-upgrade-base/pre.yml
run: playbooks/kayobe-seed-upgrade-base/run.yml run: playbooks/kayobe-seed-upgrade-base/run.yml
post-run: playbooks/kayobe-seed-upgrade-base/post.yml
attempts: 1
timeout: 5400 timeout: 5400
required-projects:
# Include kayobe to ensure other projects can use this job.
- name: x/kayobe
- name: x/kayobe-config-dev
- name: openstack/kolla
- name: openstack/kolla-ansible
- name: openstack/requirements
vars:
# Name of the release to upgrade from.
previous_release: rocky
irrelevant-files:
- ^.*\.rst$
- ^doc/.*
- ^releasenotes/.*
- ^setup.cfg$
- ^tools/.*$
- ^tox.ini$
- job: - job:
name: kayobe-seed-upgrade-centos name: kayobe-seed-upgrade-centos