hello all,
i am getting 2 array of ips from 2 different json queries in
ansible-playbook. how can i merge these 2 json queries?
in below example i want to merge jmesquery and jmesquery1
- name: master ip list from json content
#debug: msg="{{ input | json_query(jmesquery) }}"
copy: content="{{ input | json_query(jmesquery) }}" dest=../ip_address.txt
vars:
input : "{{ lookup('template', '../cluster.txt') }}"
target: "{{ input | json_query(jmesquery) }}"
jmesquery: "[*].master_group[].nodes[].private_ip"
- name: worker ip list from json content
#debug: msg="{{ input1 | json_query(jmesquery1) }}"
copy: content="{{ input1 | json_query(jmesquery1) }}"
dest=../ip_address1.txt
vars:
input1 : "{{ lookup('template', '../cluster.txt') }}"
target1: "{{ input1 | json_query(jmesquery1) }}"
jmesquery1: "[*].node_groups[].nodes[].private_ip"
please advise.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/7b967fa6-9c7a-46d5-aea9-a7123af2ac06n%40googlegroups.com.