CI: Configure the upgrade jobs from the current branch

This lets us control the upgrade process entirely from the
current branch.

Change-Id: Ic8c39e415846596c23dae93c2839375a24e8b888
Signed-off-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
This commit is contained in:
Radosław Piliszek 2019-09-18 11:03:12 +02:00
parent 6a53b0bb95
commit e2f511b7d9
5 changed files with 31 additions and 47 deletions

View File

@ -1,12 +0,0 @@
---
# Path to template file.
remote_template_src:
# Path to destination.
remote_template_dest:
# Whether to use 'become'.
remote_template_become: false
# Path on localhost to store a copy of the template.
remote_template_temp_path: "{{ zuul.executor.work_root }}/{{ remote_template_src | basename }}"

View File

@ -1,22 +0,0 @@
---
# Ensure the parent directory exists.
- name: "ensure {{ remote_template_dest | dirname }} exists"
file:
path: "{{ remote_template_dest | dirname }}"
state: "directory"
mode: 0777
become: "{{ remote_template_become }}"
# Template sources must be on localhost, so first fetch the remote template
# file.
- name: "fetch remote template {{ remote_template_src | basename }}"
fetch:
src: "{{ remote_template_src }}"
dest: "{{ remote_template_temp_path }}"
flat: true
- name: "template {{ remote_template_src | basename }}"
template:
src: "{{ remote_template_temp_path }}"
dest: "{{ remote_template_dest }}"
become: "{{ remote_template_become }}"

View File

@ -75,19 +75,28 @@
dest: /etc/kolla/template_overrides.j2
when: need_build_image # only then kolla sources are available (and used)
# Use the initial repo to generate config files. For upgrade jobs, this
# repo is only available on the remote node, so use the remote-template
# role.
- name: Ensure /etc/docker exists
file:
path: "/etc/docker"
state: directory
become: true
- name: Ensure configuration directories exist
file:
path: "/etc/kolla/config/{{ item }}"
state: directory
loop:
- nova
- bifrost
- name: generate configuration files
include_role:
role: remote-template
template:
src: "{{ kolla_ansible_local_src_dir }}/{{ item.src }}"
dest: "{{ item.dest }}"
become: "{{ item.become | default(false) }}"
vars:
is_previous_release: "{{ is_upgrade }}"
infra_dockerhub_mirror: "http://{{ zuul_site_mirror_fqdn }}:8082/"
# Role variables.
remote_template_src: "{{ kolla_ansible_src_dir }}/{{ item.src }}"
remote_template_dest: "{{ item.dest }}"
remote_template_become: "{{ item.become | default(false) }}"
with_items:
# Docker daemon.json
- src: "tests/templates/docker_daemon.json.j2"
@ -288,9 +297,6 @@
git log --pretty=oneline -1
chdir: "{{ kolla_ansible_src_dir }}"
# Use the new kolla-ansible repo to generate config files.
# This is the branch checked out on the executor, so we can use
# template directly rather than the remote-template role.
- name: Generate configuration files
template:
src: "{{ kolla_ansible_local_src_dir }}/{{ item.src }}"

View File

@ -28,7 +28,7 @@ docker_namespace: "kolla"
# NOTE(mgoddard): Ensure that the insecure local registry is trusted, since it
# will be the source of images during the upgrade.
# NOTE(yoctozepto): this is required here for CI because we run templating
# of docker systemd command only once, using the previous release when upgrading
# of docker systemd command only once
docker_custom_option: "--insecure-registry {{ api_interface_address }}:4000"
{% endif %}
{% if not is_previous_release %}

View File

@ -263,6 +263,12 @@ nova
[nova-conductor:children]
nova
# TODO(yoctozepto): Remove completely in the Ussuri cycle.
{% if is_previous_release and previous_release == 'stein' %}
[nova-consoleauth:children]
nova
{% endif %}
[nova-novncproxy:children]
nova
@ -288,6 +294,12 @@ neutron
[neutron-l3-agent:children]
neutron
# TODO(yoctozepto): Remove completely in the Ussuri cycle.
{% if is_previous_release and previous_release == 'stein' %}
[neutron-lbaas-agent:children]
neutron
{% endif %}
[neutron-metadata-agent:children]
neutron