Zuul v3: add role to set up base dir

Change-Id: I825b6fda85997d59dc136280f03e7497eb7b3c2e
This commit is contained in:
James E. Blair 2017-08-22 13:48:50 -07:00
parent 2938caf24e
commit a33308eb3b
4 changed files with 31 additions and 0 deletions

View File

@ -1,3 +1,5 @@
- hosts: all
roles:
- write-devstack-local-conf
- setup-devstack-source-dirs

View File

@ -0,0 +1,11 @@
Set up the devstack source directories
Ensure that the base directory exists, and then move the source repos
into it.
**Role Variables**
.. zuul:rolevar:: devstack_base_dir
:default: /opt/stack
The devstack base directory.

View File

@ -0,0 +1 @@
devstack_base_dir: /opt/stack

View File

@ -0,0 +1,17 @@
- name: Create base directory
file: path={{ devstack_base_dir }} state=directory
become: yes
- name: Find all source repos used by this job
find:
paths:
- src/git.openstack.org/openstack
- src/git.openstack.org/openstack-dev
- src/git.openstack.org/openstack-infra
file_type: directory
register: found_repos
- name: Move Zuul repos into place
command: mv {{ item.path }} {{ devstack_base_dir }}
with_items: '{{ found_repos.files }}'
become: yes