Spliting tempest validate and install role

Splitting the validate-yaml in two: install_skiplist and
validate_yaml. Also renaming the role to use underscore '_'
instead of dash '-' becase it will be required in future
ansible version.

The reason to this split is to reuse these roles when start
to use it in other installers, instead of reinvent the
wheel.

Change-Id: I2a736723087016db3eebf20cea48fadb658ba436
This commit is contained in:
Arx Cruz 2020-05-06 16:42:35 +02:00
parent 2eac1eeca4
commit 656077a9c9
9 changed files with 59 additions and 38 deletions

View File

@ -1,4 +1,7 @@
---
- hosts: all
roles:
- validate-yaml
- install_skiplist
- validate_yaml
vars:
tempest_skip_path: "{{ zuul.projects['opendev.org/openstack/openstack-tempest-skiplist'].src_dir }}"

View File

@ -0,0 +1,17 @@
Install tempest skiplist
========================
This role install tempest-siplist in a virtual environment.
**Role Variables**
.. zuul:rolevar:: virtualenvs.tempest_skip
:type: string
:default: ~/.virtualenvs/.tempest_skip
A path to virtualenv used to install openstack-tempest-skiplist
.. zuul:rolevar:: tempest_skip_path
:type: string
A path to the openstack-tempest-skiplist directory

View File

@ -0,0 +1,5 @@
---
virtualenvs:
tempest_skip: "~/.virtualenvs/.tempest_skip"
# Path for the tempest skip
# tempest_skip_path:

View File

@ -0,0 +1,17 @@
---
- block:
- name: Create tempest-skiplist venv with latest pip, setuptools and pbr
pip:
virtualenv: "{{ virtualenvs.tempest_skip }}"
name: "{{ item }}"
state: latest
with_items:
- pip
- setuptools
- pbr
- name: Install tempest-skiplist
pip:
name: "."
virtualenv: "{{ virtualenvs.tempest_skip }}"
chdir: "{{ tempest_skip_path }}"

View File

@ -1,15 +0,0 @@
Validate yaml schema for tempest skip
=====================================
This role install openstack-tempest-skiplist and execute the validate command
to ensure that the yaml file used to store the tempest tests to be skipped are
in the correct schema format.
**Role Variables**
.. zuul:rolevar:: tempest_skip
:type: string
:default: ~/.virtualenvs/.tempest_skip
A path to virtualenv used to install openstack-tempest-skiplist

View File

@ -1,3 +0,0 @@
---
virtualenvs:
tempest_skip: "~/.virtualenvs/.tempest_skip"

View File

@ -0,0 +1,13 @@
Validate yaml schema for tempest skip
=====================================
This role execute the validate command from tempest-skiplist to ensure that
the yaml file used to store the tempest tests to be skipped are
in the correct schema format.
**Role Variables**
.. zuul:rolevar:: tempest_skip_path
:type: string
A path to the openstack-tempest-skiplist directory

View File

@ -0,0 +1,3 @@
---
# Path for the tempest skkip
# tempest_skip_path:

View File

@ -1,21 +1,5 @@
---
- block:
- name: Create tempest-skiplist venv with latest pip, setuptools and pbr
pip:
virtualenv: "{{ virtualenvs.tempest_skip }}"
name: "{{ item }}"
state: latest
with_items:
- pip
- setuptools
- pbr
- name: Install tempest-skiplist
pip:
name: "."
virtualenv: "{{ virtualenvs.tempest_skip }}"
chdir: "{{ tempest_skip_path }}"
# TODO(arxcruz) Right now there are yaml files that are not
# a valid tempest-skiplist file, so we are using just one for now
# The task isn't useful until we get rid of the old yaml files
@ -36,6 +20,3 @@
tempest-skip validate --file "{{ tempest_skip_path }}/roles/validate-tempest/vars/tempest_skip.yml"
args:
chdir: "{{ tempest_skip_path }}"
vars:
tempest_skip_path: "{{ zuul.projects['opendev.org/openstack/openstack-tempest-skiplist'].src_dir }}"