91 lines
2.8 KiB
YAML
91 lines
2.8 KiB
YAML
- block:
|
|
- debug:
|
|
var: source_admin_credentials_commands
|
|
|
|
- debug:
|
|
var: source_demo_credentials_commands
|
|
|
|
- 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 tempetsconf dir
|
|
shell: |
|
|
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 as admin user
|
|
shell: |
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
|
{{ source_admin_credentials_commands }}
|
|
printenv
|
|
discover-tempest-config \
|
|
--debug \
|
|
-v \
|
|
--create \
|
|
identity.uri $OS_AUTH_URL \
|
|
identity.admin_password $OS_PASSWORD \
|
|
image.http_image {{ url_cirros_image }} \
|
|
object-storage.operator_role swiftoperator
|
|
register: admin_result
|
|
ignore_errors: True
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
executable: /bin/bash
|
|
|
|
- name: Print tempest.conf generated as admin user
|
|
shell: |
|
|
cat {{ tempestconf_src_relative_path }}/etc/tempest.conf
|
|
ignore_errors: True
|
|
|
|
- name: Generate tempest configuration file as demo user
|
|
shell: |
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
|
{{ source_demo_credentials_commands }}
|
|
printenv
|
|
discover-tempest-config \
|
|
--debug \
|
|
-v \
|
|
--create \
|
|
identity.uri $OS_AUTH_URL \
|
|
identity.admin_password $OS_PASSWORD \
|
|
image.http_image {{ url_cirros_image }} \
|
|
object-storage.operator_role swiftoperator
|
|
register: demo_result
|
|
ignore_errors: True
|
|
args:
|
|
chdir: "{{ tempestconf_src_relative_path }}"
|
|
executable: /bin/bash
|
|
|
|
- name: Print tempest.conf generated as demo user
|
|
shell: |
|
|
cat {{ tempestconf_src_relative_path }}/etc/tempest.conf
|
|
ignore_errors: True
|
|
|
|
- name: Fail if generation of tempest.conf failed as admin or demo user
|
|
fail: msg="Generation of tempest.conf FAILED"
|
|
when: admin_result.failed or demo_result.failed
|
|
|
|
- name: Copy tempest.conf to tempest directory
|
|
copy:
|
|
src: "{{ tempestconf_src_relative_path }}/etc/tempest.conf"
|
|
dest: "{{ ansible_user_dir }}/tempest/etc/tempest.conf"
|
|
vars:
|
|
tempestconf_src_relative_path: "{{ zuul._projects['git.openstack.org/openstack/python-tempestconf'].src_dir }}"
|