python-tempestconf/playbooks/python-tempestconf-tempest-devstack.yaml
Martin Kopec 7b2c156d52 Fix operator_role value for account-generator
When a tempest.conf is generated with admin credentials and
swift is enabled, object-storage.operator_role is set to admin.
This behavior is not wanted, when we generate tempest.conf
for tempest account-generator. In this case the operator_role
will be overriden in cli and set to Member (the same value
as tempest.conf with demo credentials contains)

Change-Id: I8b6e6a814a7cb96ef47bc6d3a8edc3f6a29aebfa
2018-06-19 10:19:05 +00:00

67 lines
2.9 KiB
YAML

- hosts: all
roles:
# the role is inherited from openstack-dev/devstack project
- run-devstack
- hosts: tempest
vars:
# It's important that OS_AUTH_URL is in this format:
# <protocol>://<host>/identity/v3
# In some cases it can be only: <protocol>://<host>:5000
# https://github.com/openstack-dev/devstack/blob/2c9343e5db44fa7a41ca6924737331dd9088ef8f/openrc#L87-L89
# (mkopec) That would end up with an HTTP MaxRetryError to <host>:5000,
# therefor OS_AUTH_URL is defined manually
set_auth_url: "OS_AUTH_URL=$SERVICE_PROTOCOL://$SERVICE_HOST/identity/v3"
devstack_base_dir: "/opt/stack"
test_demo_user: "{{ test_demo is defined }}"
tasks:
# setup-tempest-* and acl-devstack-files roles are inherited from
# openstack/tempest project
- name: Setup Tempest Run Directory
include_role:
name: setup-tempest-run-dir
- name: Setup Tempest Data Directory
include_role:
name: setup-tempest-data-dir
- name: ACL devstack files
include_role:
name: acl-devstack-files
- name: Edit clouds.yaml file
include_role:
name: tempestconf-workaround-auth-url
- name: Generate tempest configuration file
include_role:
name: generate-tempestconf-file
vars:
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc {{ user }} {{ user }}; {{ set_auth_url }}"
aditional_tempestconf_params: "auth.tempest_roles Member"
- name: Generate tempest configuration file based on cloud credentials
include_role:
name: generate-tempestconf-file-cloud
# Let's create tempest.conf with admin permissions needed for
# tempest accounts file generation
- name: Generate configuration file for Tempest as admin
include_role:
name: generate-tempestconf-file
vars:
aditional_tempestconf_params: "auth.tempest_roles Member object-storage.operator_role Member"
output_path: "/etc/openstack/tempest_admin.conf"
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc admin admin; {{ set_auth_url }}"
test_demo_user: False
user: admin
when: test_demo is defined
- name: Generate accounts file for Tempest
include_role:
name: generate-accounts-file
vars:
accounts_file_destination: "/etc/openstack"
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc admin admin; {{ set_auth_url }}"
tempest_config_file: "/etc/openstack/tempest_admin.conf"
when: test_demo is defined
# run-tempest role is inherited from openstack/tempest project
- name: Run Tempest Tests
include_role:
name: run-tempest
vars:
tempest_concurrency: 2