On Wednesday, January 14, 2015 at 9:49:05 PM UTC+2, Dan Vaida wrote:
>
> What is the error that you get when it fails?
>
400 Bad Request
Full capture below
$ ansible-playbook configure-security-group.yaml -e "key_name=$EC2_KEY_NAME"
PLAY [Provision Cassandra cluster security group]
*****************************
GATHERING FACTS
***************************************************************
ok: [127.0.0.1]
TASK: [Create security group]
*************************************************
failed: [127.0.0.1 -> 127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File
"/home/tzach/.ansible/tmp/ansible-tmp-1421306914.46-15410053363176/ec2_group",
line 2145, in <module>
main()
File
"/home/tzach/.ansible/tmp/ansible-tmp-1421306914.46-15410053363176/ec2_group",
line 293, in main
group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip,
grantGroup)
File
"/usr/lib/python2.7/site-packages/boto-2.28.0-py2.7.egg/boto/ec2/securitygroup.py",
line 204, in authorize
dry_run=dry_run)
File
"/usr/lib/python2.7/site-packages/boto-2.28.0-py2.7.egg/boto/ec2/connection.py",
line 3152, in authorize_security_group
params, verb='POST')
File
"/usr/lib/python2.7/site-packages/boto-2.28.0-py2.7.egg/boto/connection.py",
line 1196, 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>InvalidPermission.Duplicate</Code><Message>the
specified rule "peer: sg-36327b53, TCP, from port: 7000, to port: 7000,
ALLOW" already
exists</Message></Error></Errors><RequestID>8a36dc12-10e6-400c-8f27-c482a1c32c6e</RequestID></Response>
FATAL: all hosts have already failed -- aborting
PLAY RECAP
********************************************************************
to retry, use: --limit
@/home/tzach/configure-security-group.yaml.retry
127.0.0.1 : ok=1 changed=0 unreachable=0 failed=1
>
> On Wednesday, 14 January 2015 09:22:35 UTC+1, Tzach Livyatan wrote:
>>
>> newbie Ansible ec2 question:
>> I'm successfully using ec2_group_module [1] to create EC2 security group.
>> However, the operation fail if the group is already there
>> What is the idiomatic to conditionally skip it if the group is already
>> there?
>>
>> Thanks
>>
>>
>> [1] http://docs.ansible.com/ec2_group_module.html
>>
>
--
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/35d9c1fa-7621-4fa0-9fa4-2b6e01836dc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.