diff --git a/defaults/main.yml b/defaults/main.yml index 603bd7b1..8ebfa5a8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,6 +45,15 @@ tempest_cleanup: no # leftover resources to a dry_run.json file, none resources will be deleted #tempest_cleanup_dry_run: no +# Credential Provider Mechanisms +# If tempest_test_accounts is not an empty string, then use_dynamic_credentials will be turned off +tempest_test_accounts: "" +tempest_test_accounts_file_path: "{{ tempest_workspace }}/etc/tempest_accounts.yaml" +# tempest_create_isolated_networks has an effect only when use_dynamic_credentials is enabled +tempest_create_isolated_networks: true +# tempest_fixed_network_name has an effect only when tempest_create_isolated_networks is disabled +tempest_fixed_network_name: public + # Tempest Resources # Toggle whether default resources are implemented tempest_default_role_resources: yes diff --git a/releasenotes/notes/credential-provider-mechanisms-959f7479debbe448.yaml b/releasenotes/notes/credential-provider-mechanisms-959f7479debbe448.yaml new file mode 100644 index 00000000..5a72ee91 --- /dev/null +++ b/releasenotes/notes/credential-provider-mechanisms-959f7479debbe448.yaml @@ -0,0 +1,3 @@ +--- +features: + - Added a support for both Credential Provider Mechanisms(dynamic credentials and pre-provisioned credentials). diff --git a/tasks/tempest_post_install.yml b/tasks/tempest_post_install.yml index def7a929..4990aabf 100644 --- a/tasks/tempest_post_install.yml +++ b/tasks/tempest_post_install.yml @@ -186,3 +186,11 @@ mode: "0644" when: - tempest_test_excludelist | length > 0 + +- name: Drop test_accounts_file + copy: + content: "{{ tempest_test_accounts }}" + dest: "{{ tempest_test_accounts_file_path }}" + mode: "0644" + when: + - tempest_test_accounts | length > 0 diff --git a/templates/tempest.conf.j2 b/templates/tempest.conf.j2 index 86cbd5fb..e043cbd1 100644 --- a/templates/tempest.conf.j2 +++ b/templates/tempest.conf.j2 @@ -8,11 +8,17 @@ log_file = {{ tempest_log_dir}}/tempest.log [auth] +{% if tempest_test_accounts | length > 0 %} +use_dynamic_credentials = False +test_accounts_file = {{ tempest_test_accounts_file_path }} +{% else %} use_dynamic_credentials = True admin_domain_name = Default admin_username = {{ keystone_admin_user_name }} admin_project_name = {{ keystone_admin_tenant_name }} admin_password = {{ keystone_auth_admin_password }} +create_isolated_networks = {{ tempest_create_isolated_networks }} +{% endif %} [baremetal] @@ -24,7 +30,9 @@ image_ref = {{ tempest_glance_image_id_1 }} image_ref_alt = {{ tempest_glance_image_id_2 }} flavor_ref = {{ tempest_nova_flavor_id_1 }} flavor_ref_alt = {{ tempest_nova_flavor_id_2 }} -fixed_network_name = private +{% if not tempest_create_isolated_networks | bool %} +fixed_network_name = {{ tempest_fixed_network_name }} +{% endif %} endpoint_type = {{ tempest_endpoint_type }} build_timeout = 600