From e2f511b7d9991b3b402ebd802a8f218e99077d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Wed, 18 Sep 2019 11:03:12 +0200 Subject: [PATCH] CI: Configure the upgrade jobs from the current branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This lets us control the upgrade process entirely from the current branch. Change-Id: Ic8c39e415846596c23dae93c2839375a24e8b888 Signed-off-by: Radosław Piliszek --- tests/roles/remote-template/defaults/main.yml | 12 -------- tests/roles/remote-template/tasks/main.yml | 22 -------------- tests/run.yml | 30 +++++++++++-------- tests/templates/globals-default.j2 | 2 +- tests/templates/inventory.j2 | 12 ++++++++ 5 files changed, 31 insertions(+), 47 deletions(-) delete mode 100644 tests/roles/remote-template/defaults/main.yml delete mode 100644 tests/roles/remote-template/tasks/main.yml diff --git a/tests/roles/remote-template/defaults/main.yml b/tests/roles/remote-template/defaults/main.yml deleted file mode 100644 index cb638bcfbf..0000000000 --- a/tests/roles/remote-template/defaults/main.yml +++ /dev/null @@ -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 }}" diff --git a/tests/roles/remote-template/tasks/main.yml b/tests/roles/remote-template/tasks/main.yml deleted file mode 100644 index 7f0590c46c..0000000000 --- a/tests/roles/remote-template/tasks/main.yml +++ /dev/null @@ -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 }}" diff --git a/tests/run.yml b/tests/run.yml index 53a0af924f..96c7f49af0 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -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 }}" diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 70a1e31c71..6b2be99e5c 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -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 %} diff --git a/tests/templates/inventory.j2 b/tests/templates/inventory.j2 index 8b5633b28a..95f8300b22 100644 --- a/tests/templates/inventory.j2 +++ b/tests/templates/inventory.j2 @@ -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