Hi,
I’m having a very basic problem but I can’t figure out what’s wrong. This is the output I got from a debug statement with my Ansible task. All I’m trying to do is to get the GroupId to use it in the next task but it doesn’t return any value. I tried groupid.stdout.SecurityGroups[0].GroupId. Any suggestion here?
Thanks,
Stanley
{
“var”: {
“groupid.stdout”: {
“SecurityGroups”: [
{
“Description”: “Database Security Group”,
“GroupId”: “sg-b5c146d0”,
“GroupName”: “cbustntest-DBSecurityGroup-173EZM1IXG997”,
“IpPermissions”: [
{
“FromPort”: 1521,
“IpProtocol”: “tcp”,
“IpRanges”: [
{
“CidrIp”: “192.168.0.0/20”
}
],
“ToPort”: 1521,
“UserIdGroupPairs”:
}
],
“IpPermissionsEgress”: [
{
“IpProtocol”: “-1”,
“IpRanges”: [
{
“CidrIp”: “0.0.0.0/0”
}
],
“UserIdGroupPairs”:
}
],
“OwnerId”: “013185853748”,
“Tags”: [
{
“Key”: “Stack”,
“Value”: “CB-CloudFormation”
},
{
“Key”: “Name”,
“Value”: “DBSecurityGroup”
},
{
“Key”: “aws:cloudformation:logical-id”,
“Value”: “DBSecurityGroup”
},
{
“Key”: “aws:cloudformation:stack-name”,
“Value”: “cbustntest”
},
{
“Key”: “aws:cloudformation:stack-id”,
“Value”: “arn:aws:cloudformation:us-west-1:013185853748:stack/cbustntest/2061ebd0-04b8-11e5-91aa-50440c0a5ad2”
}
],
“VpcId”: “vpc-8ea370eb”
}
]
}
}
}