From 871d3cfd887099d0ff4e92f921f13f353129372f Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Wed, 1 May 2019 11:39:16 +0100 Subject: [PATCH] Use zuul checkout for stackhpc-libvirt roles This allows us to use the Depends-On: syntax in future commits. Depends-On: https://review.opendev.org/#/c/618511/ Depends-On: https://github.com/stackhpc/ansible-role-libvirt-vm/pull/29 Change-Id: I4007edf0939d21115b0e2699857a4593cae30b74 --- playbooks/tenks-deploy-teardown/pre.yml | 16 ++++++++++++++++ .../templates/requirements-overrides.yml.j2 | 10 ++++++++++ playbooks/tenks-deploy-teardown/vars/common.yml | 5 +++++ zuul.d/base.yaml | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 playbooks/tenks-deploy-teardown/templates/requirements-overrides.yml.j2 diff --git a/playbooks/tenks-deploy-teardown/pre.yml b/playbooks/tenks-deploy-teardown/pre.yml index 2420835..00c5360 100644 --- a/playbooks/tenks-deploy-teardown/pre.yml +++ b/playbooks/tenks-deploy-teardown/pre.yml @@ -24,6 +24,11 @@ requirements: "{{ tenks_src_dir }}/requirements.txt" virtualenv: "{{ tenks_venv }}" + - name: Template requirements overrides + template: + src: requirements-overrides.yml.j2 + dest: "{{ tenks_requirements_overrides_path }}" + - name: Install Ansible Galaxy dependencies vars: ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy" @@ -33,6 +38,17 @@ -p {{ tenks_src_dir }}/ansible/roles chdir: "{{ tenks_src_dir }}" + - name: Override Galaxy dependencies with equivalent modules from the zuul checkout + # We override so that as we add more dependenices we won't have to keep two files in + # sync + vars: + ansible_galaxy_bin: "{{ tenks_venv }}/bin/ansible-galaxy" + command: + cmd: >- + {{ ansible_galaxy_bin }} install -f -r "{{ tenks_requirements_overrides_path }}" + -p {{ tenks_src_dir }}/ansible/roles + chdir: "{{ tenks_src_dir }}" + - name: Ensure network bridge for physnet1 exists command: "{{ item }}" become: true diff --git a/playbooks/tenks-deploy-teardown/templates/requirements-overrides.yml.j2 b/playbooks/tenks-deploy-teardown/templates/requirements-overrides.yml.j2 new file mode 100644 index 0000000..df7bbca --- /dev/null +++ b/playbooks/tenks-deploy-teardown/templates/requirements-overrides.yml.j2 @@ -0,0 +1,10 @@ +--- + +# Override these ansible roles to point to the zuul source checkout +# so that we can rely on Depends-On: syntax + +- src: git+{{ stackhpc_libvirt_host_src_dir }}/.git + name: stackhpc.libvirt-host + +- src: git+{{ stackhpc_libvirt_vm_src_dir }}/.git + name: stackhpc.libvirt-vm diff --git a/playbooks/tenks-deploy-teardown/vars/common.yml b/playbooks/tenks-deploy-teardown/vars/common.yml index 1027ea3..84fbf3f 100644 --- a/playbooks/tenks-deploy-teardown/vars/common.yml +++ b/playbooks/tenks-deploy-teardown/vars/common.yml @@ -3,8 +3,13 @@ # Variables shared between the playbooks tenks_src_dir: "{{ ansible_env.HOME ~ '/' ~ zuul.projects['opendev.org/openstack/tenks'].src_dir }}" +stackhpc_libvirt_host_src_dir: >- + {{ ansible_env.HOME ~ '/' ~ zuul.projects['github.com/stackhpc/ansible-role-libvirt-host'].src_dir }} +stackhpc_libvirt_vm_src_dir: >- + {{ ansible_env.HOME ~ '/' ~ zuul.projects['github.com/stackhpc/ansible-role-libvirt-vm'].src_dir }} upper_constraints_path: "{{ ansible_env.HOME ~ '/' ~ zuul.projects['opendev.org/openstack/requirements'].src_dir ~ '/upper-constraints.txt' }}" tenks_venv: "{{ ansible_env.HOME ~ '/' ~ 'venv-tenks' }}" config_dir: "{{ ansible_env.HOME ~ '/' ~ 'tenks-config' }}" tenks_overrides_path: "{{ config_dir ~ '/' ~ 'tenks-overrides.yml' }}" +tenks_requirements_overrides_path: "{{ tenks_src_dir }}/requirements-overrides.yml" logs_dir: "/tmp/logs" diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index e079844..2d5f2d3 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -11,6 +11,8 @@ post-run: playbooks/tenks-deploy-teardown/post.yml required-projects: - name: openstack/requirements + - name: stackhpc/ansible-role-libvirt-vm + - name: stackhpc/ansible-role-libvirt-host attempts: 1 timeout: 1800 irrelevant-files: