Input json:

"ec2_asg": {
        "changed": false,
        "failed": false,
        "results": [
            { 
            "tags": [
                    {
                        "key": "peer_discovery_backend",
                        "propagate_at_launch": true,
                        "resource_id": "AnsibleASG",
                        "resource_type": "auto-scaling-group",
                        "value": "Rabbitmq"
                    }
]
} 

*ec2_asg.yaml:*
- name: Find a group with matching name/prefix and tags
      ec2_asg_info:
        name: "{{ AUTOSCALING_GROUP_NAME }}"
      register: ec2_asg


    - name: ASG Facts
      set_fact:
        PEER_DISCOVERY_BACKEND: "{{*ec2_asg | 
json_query('ec2_asg.results[0].tags[0][?key=='peer_discovery_backend'].value*') 
}}"


How to get the key matches and value return , i am getting error.


Thanks &Regards,
Yuvaraj K

-- 
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/b2ed19fb-c3fd-4aa0-ac8f-14bab8ad28a1n%40googlegroups.com.

Reply via email to