diff --git a/Dockerfile b/Dockerfile index 58d8d72..23205e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,5 @@ ICAgICAgIAo=" COPY playbooks /opt/apb/project COPY roles /opt/ansible/roles COPY vars /opt/ansible/vars -RUN yum install epel-release -y && yum install jq -y RUN chmod -R g=u /opt/{ansible,apb} USER apb diff --git a/roles/bind-metrics-apb/tasks/main.yml b/roles/bind-metrics-apb/tasks/main.yml index ba85058..61092b9 100644 --- a/roles/bind-metrics-apb/tasks/main.yml +++ b/roles/bind-metrics-apb/tasks/main.yml @@ -23,7 +23,7 @@ # Annotate the mobile client - name: Get metrics service instance name - shell: oc get serviceinstances -n {{ namespace }} -o json | jq '.items[] | select(.spec.externalID=="{{ _apb_service_instance_id }}") | .metadata.name' | cut -f2 -d'"' + shell: oc get serviceinstances -n {{ namespace }} -o jsonpath='{.items[?(@.spec.externalID=="{{ _apb_service_instance_id }}")].metadata.name}' register: metrics_si_name - set_fact: @@ -32,7 +32,7 @@ - set_fact: metricsEndpointAnnotation: "org.aerogear.binding.{{ metricsInstanceName }}/metrics_endpoint" grafanaUrlAnnotation: "org.aerogear.binding.{{ metricsInstanceName }}/grafana_url" - + - name: Annotate client {{ CLIENT_ID }} shell: 'oc annotate mobileclient {{ CLIENT_ID }} {{ item }} --overwrite=true -n {{ namespace }}' ignore_errors: yes @@ -54,4 +54,4 @@ - { name: clientId, value: '{{ CLIENT_ID }}' } - { name: metricsInstanceName, value: '{{ metricsInstanceName }}' } when: not encode_asb_binding - no_log: yes \ No newline at end of file + no_log: yes