| | |
| | | command: "oc volume dc/static --add --name=custom --configmap-name=webconsole-customization --mount-path=/opt/app-root/src/custom -n openshift-web-console" |
| | | |
| | | - name: Get route for static server |
| | | command: "oc get route/static -n openshift-web-console -o jsonpath='{ .spec.host }' " |
| | | register: webconsole-url |
| | | command: "oc get route/static -n openshift-web-console -o jsonpath='{ .spec.host }'" |
| | | register: webconsole_url |
| | | |
| | | - name: Export webconsole-config yaml file from configmap |
| | | shell: "oc get cm/webconsole-config -n openshift-web-console -o jsonpath='{ .data.webconsole-config\\.yaml }' > /tmp/webconsole-config.yaml" |
| | | |
| | | - name: Patch webconsole-config.yml |
| | | shell: "sed -i -e 's/scriptURLs: \\[\\]/scriptURLs:/g' -e '/scriptURLs:/a\\ - https:\\/\\/{{ webconsole-url.stdout }}\\/custom\\/custom-categories\\.js' /tmp/webconsole-config.yaml" |
| | | lineinfile: |
| | | path: "/tmp/webconsole-config.yaml" |
| | | regexp: " scriptURLs." |
| | | line: " scriptURLs:\n - https://{{ webconsole_url.stdout }}/custom/custom-categories.js" |
| | | |
| | | - name: Import webconsole-config yaml file from configmap |
| | | shell: "oc create configmap webconsole-config --from-file=webconsole-config.yaml=/tmp/webconsole-config.yaml -n openshift-web-console --dry-run -o yaml | oc replace -f -" |