|
|
@ -1,19 +1,22 @@ |
|
|
--- |
|
|
--- |
|
|
|
|
|
- name: Create a temporary directory |
|
|
|
|
|
tempfile: state=directory |
|
|
|
|
|
register: tempfile |
|
|
|
|
|
|
|
|
- name: Download 'apicast_cors.lua' |
|
|
- name: Download 'apicast_cors.lua' |
|
|
get_url: dest='/home/{{ ansible_user }}/apicast_cors.lua' url={{ threescale_apicast_cors_lua }} |
|
|
get_url: dest='{{ tempfile.path }}/apicast_cors.lua' url={{ threescale_apicast_cors_lua }} |
|
|
|
|
|
|
|
|
- name: Download 'cors.conf' |
|
|
- name: Download 'cors.conf' |
|
|
get_url: dest='/home/{{ ansible_user }}/cors.conf' url={{ threescale_apicast_cors_conf }} |
|
|
get_url: dest='{{ tempfile.path }}/cors.conf' url={{ threescale_apicast_cors_conf }} |
|
|
|
|
|
|
|
|
- name: Create ConfigMap 'apicast-cors' |
|
|
- name: Create ConfigMap 'apicast-cors' |
|
|
command: chdir=/home/{{ ansible_user }}/ oc create configmap apicast-cors --from-file=apicast_cors.lua -n "{{ threescale_project }}" |
|
|
command: chdir={{ tempfile.path }} oc create configmap apicast-cors --from-file=apicast_cors.lua -n "{{ threescale_project }}" |
|
|
register: oc |
|
|
register: oc |
|
|
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr |
|
|
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr |
|
|
changed_when: oc.rc == 0 |
|
|
changed_when: oc.rc == 0 |
|
|
|
|
|
|
|
|
- name: Create ConfigMap 'cors-conf' |
|
|
- name: Create ConfigMap 'cors-conf' |
|
|
command: oc create configmap cors-conf --from-file=cors.conf -n "{{ threescale_project }}" |
|
|
command: chdir={{ tempfile.path }} oc create configmap cors-conf --from-file=cors.conf -n "{{ threescale_project }}" |
|
|
register: oc |
|
|
register: oc |
|
|
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr |
|
|
failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr |
|
|
changed_when: oc.rc == 0 |
|
|
changed_when: oc.rc == 0 |
|
|
|