| # Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| # license agreements; and to You under the Apache License, Version 2.0. |
| --- |
| # This role will install apigateway |
| |
| - name: (re)start apigateway |
| docker_container: |
| name: apigateway |
| image: "{{ apigateway.docker_image | default('openwhisk/apigateway:' ~ apigateway.version) }}" |
| state: started |
| recreate: true |
| restart_policy: "{{ docker.restart.policy }}" |
| hostname: apigateway |
| env: |
| "REDIS_HOST": "{{ groups['redis'] | first }}" |
| "REDIS_PORT": "{{ redis.port }}" |
| "PUBLIC_MANAGEDURL_HOST": "{{ ansible_host }}" |
| "PUBLIC_MANAGEDURL_PORT": "{{ apigateway.port.mgmt }}" |
| ports: |
| - "{{ apigateway.port.mgmt }}:8080" |
| - "{{ apigateway.port.api }}:9000" |
| pull: "{{ apigateway_local_build is undefined }}" |
| |
| - name: wait until the API Gateway in this host is up and running |
| uri: |
| url: "http://{{ groups['apigateway'] | first }}:{{ apigateway.port.api }}/v1/apis" |
| register: result |
| until: result.status == 200 |
| retries: 12 |
| delay: 5 |