From 36ed98f054797cc543360cdecea290d8ad18f506 Mon Sep 17 00:00:00 2001 From: Gerard Ryan Date: Wed, 5 Dec 2018 11:43:00 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20need=20for=20jq?= =?UTF-8?q?=20(use=20jsonpath=20instead)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 - roles/bind-metrics-apb/tasks/main.yml | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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