
The patch implements --profile argument, which defines a path to a profile.yaml file - a file which contains python-tempestconf arguments and their values. Also --generate-profile argument is introduced. A user can generate a sample profile.yaml file using this argument. The sample contains definitions of all python-tempestconf arguments set to their default values. Story: 2004503 Task: 28225 Change-Id: I80848d8ef9868ed3975b938d61880753eadc5ae9
101 lines
2.9 KiB
YAML
101 lines
2.9 KiB
YAML
- block:
|
|
- name: Create python-tempestconf venv with latest pip, setuptools and pbr
|
|
pip:
|
|
virtualenv: "{{ virtualenvs.tempestconf }}"
|
|
name: "{{ item }}"
|
|
state: latest
|
|
with_items:
|
|
- pip
|
|
- setuptools
|
|
- pbr
|
|
|
|
- name: Debug, list tempestconf dir
|
|
shell: |
|
|
set -ex
|
|
ls -all .
|
|
pwd
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
|
|
- name: Install python-tempestconf
|
|
pip:
|
|
name: "."
|
|
virtualenv: "{{ virtualenvs.tempestconf }}"
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
|
|
- name: Generate tempest configuration file
|
|
shell: |
|
|
set -ex
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
|
printenv
|
|
discover-tempest-config \
|
|
--out etc/cloud_tempest.conf \
|
|
--debug \
|
|
-v \
|
|
{% if cloud_user == "devstack-admin" %}
|
|
--create \
|
|
{% else %}
|
|
--non-admin \
|
|
{% endif %}
|
|
--os-cloud {{ cloud_user }} \
|
|
auth.tempest_roles Member
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
executable: /bin/bash
|
|
|
|
- set_fact:
|
|
profile:
|
|
debug: true
|
|
out: etc/tempest_profile.conf
|
|
verbose: true
|
|
create: "{{ cloud_user == 'devstack-admin' }}"
|
|
non_admin: "{{ cloud_user == 'devstack' }}"
|
|
os_cloud: "{{ cloud_user }}"
|
|
overrides:
|
|
auth.tempest_roles: Member
|
|
|
|
- name: Generate sample profile.yaml file
|
|
shell: |
|
|
set -ex
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
|
printenv
|
|
discover-tempest-config \
|
|
--generate-profile ./etc/profile.yaml
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
executable: /bin/bash
|
|
|
|
- name: Edit the profile.yaml file
|
|
copy:
|
|
content: "{{ profile | to_nice_yaml }}"
|
|
dest: "{{ tempestconf_src_relative_path }}/etc/profile.yaml"
|
|
|
|
- name: Generate tempest configuration file with profile.yaml
|
|
shell: |
|
|
set -ex
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
|
printenv
|
|
cat ./etc/profile.yaml
|
|
discover-tempest-config \
|
|
--profile ./etc/profile.yaml
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
executable: /bin/bash
|
|
|
|
- name: Diff tempest.conf and tempest_profile.conf
|
|
shell: |
|
|
diff ./etc/cloud_tempest.conf ./etc/tempest_profile.conf
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
|
|
- name: Print generated tempest.conf
|
|
shell: |
|
|
set -ex
|
|
cat {{ tempestconf_src_relative_path }}/etc/cloud_tempest.conf
|
|
|
|
vars:
|
|
tempestconf_src_relative_path: "{{ zuul.projects['git.openstack.org/openstack/python-tempestconf'].src_dir }}"
|