Skip to content

Commit

Permalink
🔥 Remove the need for jq (use jsonpath instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
grdryn committed Dec 6, 2018
1 parent 8b12d9a commit 2af3d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ ICAgICAgIAo="
COPY playbooks /opt/apb/actions
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
6 changes: 3 additions & 3 deletions roles/bind-metrics-apb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -54,4 +54,4 @@
- { name: clientId, value: '{{ CLIENT_ID }}' }
- { name: metricsInstanceName, value: '{{ metricsInstanceName }}' }
when: not encode_asb_binding
no_log: yes
no_log: yes

0 comments on commit 2af3d93

Please sign in to comment.