From 1700449c6393b3afea4bd2e8f285aa3ee67f385c Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Wed, 16 Jan 2019 14:07:37 +0530 Subject: [PATCH] Add tempest_interface_name var for setting interface Currently in tasks/tempest_resources.yml file, we are using ansible provided openstack cloud modules which needs which is harded to internal. When os_tempest role is getting used with different deployment tool, interface varies. Adding tempest_interface_name var mades it easier to use any interface in clouds.yaml file. It removes legacy endpoint_type and replaces it with interface. Change-Id: I8f6a71a1f31069d2f553275e27ecebd971ce0152 --- defaults/main.yml | 3 +++ tasks/tempest_resources.yml | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index f5330e57..72839353 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -291,6 +291,9 @@ tempest_cloud_name: "default" ## The name of domain from clouds.yaml tempest_domain_name: "default" +## The name of interface from clouds.yaml +tempest_interface_name: "internal" + # python-tempestconf variables # The tempest_use_tempestconf by default is set to false, set to true if you # want to generate the tempest.conf file with this tool, instead of diff --git a/tasks/tempest_resources.yml b/tasks/tempest_resources.yml index a2dbdcb5..6e1f2838 100644 --- a/tasks/tempest_resources.yml +++ b/tasks/tempest_resources.yml @@ -53,7 +53,7 @@ - name: Upload tempest images to glance os_image: cloud: "{{ tempest_cloud_name }}" - interface: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ not (keystone_service_internaluri_insecure | bool) }}" name: "{{ item.name | default(item.url | basename) }}" filename: "{{ tempest_image_dir }}/{{ item.url | basename }}" @@ -83,7 +83,7 @@ name: "{{ item }}" description: "{{ item }} project" domain: "{{ tempest_domain_name }}" - interface: internal + interface: "{{ tempest_interface_name }}" verify: "{{ not (keystone_service_internaluri_insecure | bool) }}" register: add_project until: add_project is success @@ -99,7 +99,7 @@ password: "{{ item.password | default(item.name) }}" domain: "{{ tempest_domain_name }}" default_project: "{{ item.project | default(item.name) }}" - interface: internal + interface: "{{ tempest_interface_name }}" verify: "{{ not (keystone_service_internaluri_insecure | bool) }}" register: add_user until: add_user is success @@ -111,7 +111,7 @@ - name: Add tempest roles os_keystone_role: cloud: "{{ tempest_cloud_name }}" - interface: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ not (keystone_service_internaluri_insecure | bool) }}" name: "{{ item }}" register: add_role @@ -127,7 +127,7 @@ user: "{{ item.name }}" role: "heat_stack_owner" project: "{{ item.project | default(item.name) }}" - interface: internal + interface: "{{ tempest_interface_name }}" verify: "{{ not (keystone_service_internaluri_insecure | bool) }}" register: add_user_role until: add_user_role is success @@ -144,7 +144,7 @@ - name: Ensure private network exists os_network: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" name: "{{ tempest_private_net_name }}" provider_network_type: "{{ tempest_private_net_provider_type }}" @@ -166,7 +166,7 @@ - name: Ensure public network exists os_network: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" name: "{{ tempest_public_net_name }}" provider_network_type: "{{ tempest_public_net_provider_type }}" @@ -188,7 +188,7 @@ - name: Ensure private subnet exists os_subnet: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" network_name: "{{ tempest_private_net_name }}" name: "{{ tempest_private_subnet_name }}" @@ -204,7 +204,7 @@ - name: Ensure public subnet exists os_subnet: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" network_name: "{{ tempest_public_net_name }}" name: "{{ tempest_public_subnet_name }}" @@ -222,7 +222,7 @@ - name: Create router os_router: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" name: router network: "{{ tempest_public_net_name }}" @@ -239,7 +239,7 @@ - name: Create tempest flavors os_nova_flavor: cloud: "{{ tempest_cloud_name }}" - endpoint_type: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ keystone_service_internaluri_insecure | ternary(false, true) }}" name: "{{ item.name }}" flavorid: "{{ item.id }}" @@ -258,7 +258,7 @@ os_project_facts: cloud: "{{ tempest_cloud_name }}" name: admin - interface: internal + interface: "{{ tempest_interface_name }}" validate_certs: "{{ not (keystone_service_internaluri_insecure | bool) }}" register: _get_admin_project until: _get_admin_project is success