@ -66,23 +66,43 @@
set_fact:
threescale_cicd_api_system_name_suffix : '{{ (threescale_cicd_api_system_name is not defined)|ternary("_" ~ (threescale_cicd_api_version_major|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ')), "") }}'
- name : Compute the system_name prefix to prepend to the generated system_name
set_fact:
threescale_cicd_api_system_name_prefix : '{{ (threescale_cicd_api_system_name is not defined and threescale_cicd_env is defined)|ternary((threescale_cicd_env|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ')) ~ "_", "") }}'
- name : Extract the wanted system_name from OpenAPI
set_fact:
threescale_cicd_api_system_name : '{{ threescale_cicd_openapi_file_content.info[' 'x-threescale-system-name' ']|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ') }}'
threescale_cicd_api_system_name : '{{ threescale_cicd_openapi_file_content.info[' 'x-threescale-system-name' ']|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ')|lower }}'
when : 'threescale_cicd_api_system_name is not defined and ' 'x-threescale-system-name' ' in threescale_cicd_openapi_file_content.info'
- name : Generate a system_name from the API title
set_fact:
threescale_cicd_api_system_name : '{{ threescale_cicd_openapi_file_content.info[' 'title' ']|default(' 'api' ')|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ') }}'
threescale_cicd_api_system_name : '{{ threescale_cicd_openapi_file_content.info[' 'title' ']|default(' 'api' ')|regex_replace(' '[^a-zA-Z0-9_]+' ', ' '_' ')|lower }}'
when : 'threescale_cicd_api_system_name is not defined'
- name : Append the major version to the system_name
set_fact:
threescale_cicd_api_system_name : '{{ threescale_cicd_api_system_name }}{{ threescale_cicd_api_system_name_suffix }}'
- name : Set the threescale_cicd_apicast_{sandbox,production}_endpoint variable from the wildcard domain
set_fact:
threescale_cicd_apicast_sandbox_endpoint : '{{ threescale_cicd_default_apicast_scheme }}://{{ threescale_cicd_api_system_name|regex_replace(' '[^a-zA-Z0-9-]+' ', ' '-' ')|lower }}{{ threescale_cicd_default_staging_suffix }}.{{ threescale_cicd_wildcard_domain }}'
threescale_cicd_apicast_production_endpoint : '{{ threescale_cicd_default_apicast_scheme }}://{{ threescale_cicd_api_system_name|regex_replace(' '[^a-zA-Z0-9-]+' ', ' '-' ')|lower }}{{ threescale_cicd_default_production_suffix }}.{{ threescale_cicd_wildcard_domain }}'
when : 'threescale_cicd_wildcard_domain is defined'
- name : Prefix the system_name with the environment
set_fact:
threescale_cicd_api_system_name : '{{ threescale_cicd_api_system_name_prefix }}{{ threescale_cicd_api_system_name }}'
- name : Append the full version to the API title
set_fact:
threescale_cicd_api_name : '{{ threescale_cicd_api_name }} (v{{ threescale_cicd_api_version }})'
when : 'threescale_cicd_env is not defined'
- name : Append the full version and the environment to the API title
set_fact:
threescale_cicd_api_name : '{{ threescale_cicd_api_name }} ({{ threescale_cicd_env|upper }}, v{{ threescale_cicd_api_version }})'
when : 'threescale_cicd_env is defined'
- name : Extract the security definitions and requirements from OpenAPI
set_fact: