Hello,
I have a registered variable with the following output. How do I iterate the results to get groups->name and tags->Name ?
ok: [127.0.0.1] => {
“ec2_facts”: {
“changed”: false,
“msg”: “All items completed”,
“results”: [
{
“_ansible_no_log”: false,
“changed”: false,
“instances”: [
{
“ami_launch_index”: “0”,
“architecture”: “x86_64”,
“client_token”: “redacted”,
“ebs_optimized”: false,
“groups”: [
{
“id”: “redacted”,
“name”: “redacted”
}
],
“hypervisor”: “xen”,
“id”: “redacted”,
“image_id”: “redacted”,
“instance_profile”: {
“arn”: “arn:aws:iam::redacted:instance-profile/redacted”,
“id”: “redacted”
},
“interfaces”: [
{
“id”: “redacted”,
“mac_address”: “redacted”
}
],
“kernel”: null,
“key_name”: “redacted”,
“launch_time”: “2016-12-02T23:05:05.000Z”,
“monitoring_state”: “enabled”,
“persistent”: false,
“placement”: {
“tenancy”: “default”,
“zone”: “eu-central-1a”
},
“private_dns_name”: “redacted”,
“private_ip_address”: “redacted”,
“public_dns_name”: “redacted”,
“ramdisk”: null,
“region”: “eu-central-1”,
“requester_id”: null,
“root_device_type”: “ebs”,
“source_destination_check”: “true”,
“spot_instance_request_id”: null,
“state”: “running”,
“tags”: {
“redacted”: “redacted”,
“Name”: “redacted”,
“aws:autoscaling:groupName”: “redacted”
},
“virtualization_type”: “hvm”,
“vpc_id”: “redacted”
},
Thanks
Chanaka