Skip to content

Commit 3aaadfe

Browse files
committed
take out jq requirement by using built-in json parser
1 parent 888f1a1 commit 3aaadfe

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

example-playbooks/restore_scylla_manager_backup/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ It requires Scylla Manager 2.4 or newer.
99
1. Scylla Manager Agent installed on all the nodes.
1010
1. Access to the backup location from all the nodes.
1111
1. New cluster is registered in ScyllaDB Manager.
12-
1. jq is installed on all the nodes.
1312

1413

1514
## Parameters

example-playbooks/restore_scylla_manager_backup/restore.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@
3131

3232
- name: Get names of the tables in the snapshot {{ snapshot_tag }}
3333
shell: |
34-
scylla-manager-agent download-files -L {{ backup_location }} -n {{ host_id[inventory_hostname] }} -T {{ snapshot_tag }} --dump-manifest 2>/dev/null | jq -r '.index[] | [.keyspace,.table] | join(".")'
34+
scylla-manager-agent download-files -L {{ backup_location }} -n {{ host_id[inventory_hostname] }} -T {{ snapshot_tag }} --dump-manifest
3535
become_user: scylla
36-
register: _tables_list
36+
vars:
37+
ansible_pipelining: true
38+
register: _manifest_output
39+
40+
- name: Parse table names from manifest
41+
set_fact:
42+
_tables_list:
43+
stdout_lines: "{{ (_manifest_output.stdout | from_json).index | map(attribute='keyspace') | zip((_manifest_output.stdout | from_json).index | map(attribute='table')) | map('join', '.') | list }}"
44+
stdout: "{{ ((_manifest_output.stdout | from_json).index | map(attribute='keyspace') | zip((_manifest_output.stdout | from_json).index | map(attribute='table')) | map('join', '.') | list) | join('\n') }}"
3745

3846
- name: Save tables names list as a fact
3947
set_fact:

0 commit comments

Comments
 (0)