What do you mean by 'merging json queries'? I know json data structures can be merged, but queries?
For example you can merge input and input1 into a new structure, and then have a single json_query? Or ....? On Tue, 23 Mar 2021 at 13:02, Sakshi Rathore <[email protected]> wrote: > > 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. -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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/CAL8fbwMyV99aEzsb4Ej-HjaOowkiQ3HEqiPnYV6odm8TDu7DCg%40mail.gmail.com.
