In most cases, many of tempest resources are not needed.
From the other hand, some of our contributors still need them so we
can't just drop this functionality from this role.
The best solution I see is to add more flexibility and let users
choose which resources should be created by tempest role.
- public network:
new variable: bool tempest_public_net_create (default: true)
if false: require tempest_neutron_public_network_id to be set
if true: require all other tempest_public_net_* variables to be set
explanation: it'd be useful to choose if user wants to use already
existing public net or create a new one/
- private network:
new variable: bool tempest_private_net_create (default: false)
if true: require all tempest_private_* variables to be set
explanation: by default tempest has use_dynamic_credentials &
create_isolated_networks enabled, so it spawns an usable network,
subnet, and router when needed for each project it creates, so in
most cases it doesn't make sense to create special 'private' net.
- router:
new variable: bool tempest_router_create (default: false)
if true: both tempest_public_net_create and
tempest_private_net_create should be enabled
explanation: same case as for private network
- image:
new variable: bool tempest_images_create (default: true)
if false: require tempest_glance_image_id_1,
tempest_glance_image_id_2 to be set
explanation: tempest needs public images, so it'd be useful to just
use already existing ones
- flavor:
new variable: bool tempest_flavors_create (default: true)
if false: require tempest_nova_flavor_id_1, tempest_nova_flavor_id_2
to be set
explanation: tempest needs public flavors, so it'd be useful to just
use already existing ones
- projects:
new variable: bool tempest_projects_create (default:
"{{ tempest_public_net_create or tempest_private_net_create or
tempest_public_router_create }}")
explanation: by default tempest has use_dynamic_credentials &
create_isolated_networks enabled, so we don't need to create any
'static' projects, but network resources spawned by tempest
playbook belong to this project, so it should exist if any of
these resources are going to be created
I don't see any reason why users and tempest role should be created
so i dropped this functionality.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/825166
Change-Id: Icb46f5cb9e2dda6511cc49e30587f541aa7e399f
3.0 KiB
os_tempest configuration
This page shows all of the variables which can be set in order to
control the behaviour of os_tempest role and provides
examples on how to do so.
For a list of all variables with a default value set, please, refer to the this page.
Set the name of the cloud
os-tempest uses named cloud credentials so it requires
the name of the cloud the role will be executed against. The name is
provided to os-tempest via the
tempest_cloud_name variable. In order to use named clouds a
clouds.yaml file needs to be present on the target
host. clouds.yaml file needs to be stored at one
of the supported locations, see
here For more information about named clouds, please, follow to the
os-client-config
official documentation
Warning
clouds.yaml file has to be present on the target host -
the host os_tempest is gonna be executed against.
Resource creation
Tempest requires some openstack resources(like flavors and images) in order to function properly. It is possible to choose which resources should be created or to skip resource creation at all. Below example shows how to use already existing public network and images.
tempest_default_role_resources: true
tempest_public_net_create: false
tempest_neutron_public_network_id: <network_id>
tempest_images_create: false
tempest_glance_image_id_1: <image_id>
tempest_glance_image_id_2: <image_id>python-tempestconf
python-tempestconf is a tool which generates a
tempest.conf file necessary for Tempest execution. For more
information about the tool, please, follow
its official documentation.
If you want os_tempest to execute
python-tempestconf, prior to Tempest execution in order to
generate tempest.conf file, set
tempest_use_tempestconf variable to true:
tempest_use_tempestconf: trueMore information about python-tempestconf arguments can
be
found here.
The best way how to pass any arguments to
python-tempestconf is using its profile
feature.
os_tempest provides tempest_tempestconf_profile
variable for setting desired python-tempestconf's arguments. For
example, if you wanted to define debug to
true, os-cloud to demo and override
output of python-tempestconf to
/my/location/tempest.conf, it would be done by:
tempest_tempestconf_profile:
debug: true
os-cloud: demo
out: /my/location/tempest.conf