--- - name: Create a temporary directory tempfile: state=directory register: tempfile - name: Use a local copy of the 3scale/apicast GIT repo set_fact: threescale_apicast_git_repo: 'http://{{ offline_git_route }}/{{ threescale_apicast_git_repo|basename|regex_replace(''[.]git$'', '''') }}' when: 'is_offline|default(false)|bool' - name: Check out the 3scale/apicast GIT repo git: repo: '{{ threescale_apicast_git_repo }}' dest: '{{ tempfile.path }}' version: '{{ threescale_apicast_tag|default(''master'') }}' - name: Create ConfigMap 'apicast-custom-module' command: chdir={{ tempfile.path }} oc create configmap apicast-custom-module --from-file=examples/cors/cors.lua -n "{{ threescale_project }}" register: oc failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr changed_when: oc.rc == 0 - name: Create ConfigMap 'cors-conf' command: chdir={{ tempfile.path }} oc create configmap apicast.d --from-file=examples/cors/cors.conf -n "{{ threescale_project }}" register: oc failed_when: oc.rc > 0 and 'Error from server (AlreadyExists):' not in oc.stderr changed_when: oc.rc == 0 - include: patch_apicast.yml with_items: - apicast-staging - apicast-production