Skip to content

Commit

Permalink
Use zuul checkout for stackhpc-libvirt roles
Browse files Browse the repository at this point in the history
This allows us to use the Depends-On: syntax in future commits.

Depends-On: https://review.opendev.org/#/c/618511/
Depends-On: stackhpc/ansible-role-libvirt-vm#29
Change-Id: I4007edf0939d21115b0e2699857a4593cae30b74
  • Loading branch information
jovial committed May 7, 2019
1 parent d7142c0 commit 871d3cf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions playbooks/tenks-deploy-teardown/pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions playbooks/tenks-deploy-teardown/vars/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions zuul.d/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 871d3cf

Please sign in to comment.