Browse Source

when an api is freshly created, there is not proxy definition for the prod environment: be prepared for that

pull/25/head
Nicolas Massé 8 years ago
parent
commit
9021586a86
  1. 6
      tasks/promote.yml

6
tasks/promote.yml

@ -13,10 +13,16 @@
uri: uri:
url: 'https://{{ inventory_hostname }}/admin/api/services/{{ threescale_cicd_api_service_id }}/proxy/configs/{{ threescale_cicd_production_environment_name }}/latest.json?access_token={{ threescale_cicd_access_token|urlencode }}' url: 'https://{{ inventory_hostname }}/admin/api/services/{{ threescale_cicd_api_service_id }}/proxy/configs/{{ threescale_cicd_production_environment_name }}/latest.json?access_token={{ threescale_cicd_access_token|urlencode }}'
validate_certs: no validate_certs: no
status_code: 200,404
register: threescale_cicd_tmpresponse register: threescale_cicd_tmpresponse
- set_fact: - set_fact:
threescale_cicd_tmp_production_proxy_version: '{{ threescale_cicd_tmpresponse.json.proxy_config.version }}' threescale_cicd_tmp_production_proxy_version: '{{ threescale_cicd_tmpresponse.json.proxy_config.version }}'
when: 'threescale_cicd_tmpresponse.status == 200'
- set_fact:
threescale_cicd_tmp_production_proxy_version: 'NONE'
when: 'threescale_cicd_tmpresponse.status == 404'
- set_fact: - set_fact:
threescale_cicd_tmp_body_create_svc: 'access_token={{ threescale_cicd_access_token|urlencode }}&to={{ threescale_cicd_production_environment_name|urlencode }}' threescale_cicd_tmp_body_create_svc: 'access_token={{ threescale_cicd_access_token|urlencode }}&to={{ threescale_cicd_production_environment_name|urlencode }}'

Loading…
Cancel
Save