I have the following as part of a play:
- ec2_group:
name: group-name
description: "firewall"
vpc_id: "{{ vpc_id }}"
region: "{{ region }}"
purge_rules: false
purge_rules_egress: false
rules:
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 0.0.0.0/0
...
#- proto: all
# group_name: group-name
register: group_sg
- debug: msg="group_id -- {{ group_sg.group_id }}"
which fails with the error:
TASK: [debug msg="group_id -- {{ group_sg.group_id }}"]
**********************
fatal: [localhost] => One or more undefined variables: 'dict object' has no
attribute 'group_id'
Isn't this the right way of getting this attribute? Or this is not an
option for a SG created inside VPC? The SG is being created fine though for
the specified VPC and region.
Another thing is that I'm anable to use:
- proto: all
group_name: group-name
as in the official Ansible page example in the rules since I'm getting the
following error:
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line
1226, in get_status
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidGroup.NotFound</Code><Message>You
have specified two resources that belong to different
networks.</Message></Error></Errors><RequestID>dee577be-...</RequestID></Response>
Any ideas?
$ ansible --version
ansible 1.9.1
Thanks,
Igor
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/73f37d6a-f9b5-4219-92cb-665d0f250e6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.