summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorevanccopengeo <ecarter@opengeo.org>2014-06-03 14:25:48 -0400
committerJames Cammarata <jimi@sngx.net>2014-06-09 14:11:12 -0500
commit7cb7fdc2a7d6bb6eda07d55357388d6f3f19ce35 (patch)
treeeae8d4a700393dd3604c345e40b05a19d4dfb088
parent936e1de18bca8c9353b8d27383bf33252ec2f6a7 (diff)
downloadansible-7cb7fdc2a7d6bb6eda07d55357388d6f3f19ce35.tar.gz
fixing problem where ansible would error out because Amazon was saying the group didnt exist yet (needed to wait a few more seconds for amazon to propagate correctly)
-rw-r--r--library/cloud/ec2_group4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/cloud/ec2_group b/library/cloud/ec2_group
index 0a6b2a251e..91093c9e9b 100644
--- a/library/cloud/ec2_group
+++ b/library/cloud/ec2_group
@@ -230,6 +230,10 @@ def main():
# to 0.0.0.0/0 is added automatically but it's not
# reflected in the object returned by the AWS API
# call. We re-read the group for getting an updated object
+ # amazon sometimes takes a couple seconds to update the security group so wait till it exists
+ while len(ec2.get_all_security_groups(filters={ 'group_id': group.id, })) == 0:
+ time.sleep(0.1)
+
group = ec2.get_all_security_groups(group_ids=(group.id,))[0]
changed = True
else: