tools/provision: remove json_query usage from ansible playbooks

`json_query` requires python3-jmespath which, while available in the
repos, it can sometimes cause issues when the ansible interpreter is
different from the system interpreter.
The `json_query` is only used in a handful of locations that can easily
be served by `jq`, which we use in other places already.
This commit is contained in:
Achilleas Koutsou 2022-01-14 13:22:39 +01:00
parent 5617a0744a
commit 93c0485531
3 changed files with 16 additions and 12 deletions

View file

@ -43,12 +43,12 @@
# case: check ostree commit correctly updated
- name: get deployed ostree commit
command: rpm-ostree status --json
shell: rpm-ostree status --json | jq -r '.deployments[0].checksum'
register: result_commit
- name: make a json result
set_fact:
deploy_commit: "{{ result_commit.stdout | from_json | json_query('deployments[0].checksum') }}"
deploy_commit: "{{ result_commit.stdout }}"
- name: check commit deployed and built
block:
@ -468,12 +468,12 @@
- name: check ostree commit after rollback
block:
- name: check ostree commit after rollback
command: rpm-ostree status --json
shell: rpm-ostree status --json | jq -r '.deployments[0].checksum'
register: result_commit
- name: make a json result
set_fact:
deploy_commit: "{{ result_commit.stdout | from_json | json_query('deployments[0].checksum') }}"
deploy_commit: "{{ result_commit.stdout }}"
- assert:
that:

View file

@ -26,12 +26,12 @@
# case: check ostree commit correctly updated
- name: get deployed ostree commit
command: rpm-ostree status --json
shell: rpm-ostree status --json | jq -r '.deployments[0].checksum'
register: result_commit
- name: make a json result
set_fact:
deploy_commit: "{{ result_commit.stdout | from_json | json_query('deployments[0].checksum') }}"
deploy_commit: "{{ result_commit.stdout }}"
- name: check commit deployed and built
block:
@ -451,12 +451,12 @@
- name: check ostree commit after rollback
block:
- name: check ostree commit after rollback
command: rpm-ostree status --json
shell: rpm-ostree status --json | jq -r '.deployments[0].checksum'
register: result_commit
- name: make a json result
set_fact:
deploy_commit: "{{ result_commit.stdout | from_json | json_query('deployments[0].checksum') }}"
deploy_commit: "{{ result_commit.stdout }}"
- assert:
that: