Skip to content

Yet another rebase attempt for standardizing AWS parameters - #3894

Merged
jimi-c merged 3 commits into
ansible:develfrom
bpennypacker:rb2
Aug 24, 2013
Merged

Yet another rebase attempt for standardizing AWS parameters#3894
jimi-c merged 3 commits into
ansible:develfrom
bpennypacker:rb2

Conversation

@bpennypacker

Copy link
Copy Markdown
Contributor

Here's another attempt at standardizing all the AWS parameters, etc. Github is telling me that this can be automatically merged, so if it needs to be rebased again please provide some details. Simply saying "Because github is indicating that it will not merge cleanly" is not at all helpful.

No idea if I'm rebasing properly or not.  This is my first attempt.
@jimi-c

jimi-c commented Aug 20, 2013

Copy link
Copy Markdown
Member

Sorry you have to keep doing that, but you are touching a large number of files so any other commits on those files that get merged in ahead of this will trample it and require a rebase (and the ec2 modules seem to be high-traffic areas).

@jimi-c

jimi-c commented Aug 22, 2013

Copy link
Copy Markdown
Member

@lwade any chance you could take a look at this? Overall it looks ok to me.

It does look like my change to the route53 module broke the clean pull request again, but I'll go ahead and just cherry pick these myself and resolve the conflict if need-be (the second commit appears to be a .orig file that should probably be left out anyway).

@jimi-c

jimi-c commented Aug 23, 2013

Copy link
Copy Markdown
Member

I've found a couple of problems with the ec2_elb module already:

diff --git a/library/cloud/ec2_elb b/library/cloud/ec2_elb
index a8131c2..a946f41 100644
--- a/library/cloud/ec2_elb
+++ b/library/cloud/ec2_elb
@@ -196,7 +196,7 @@ def main():
             state={'required': True,
                     'choices': ['present', 'absent']},
             instance_id={'required': True},
-            ec2_elbs={'default': None, 'required': False},
+            ec2_elbs={'default': None, 'required': False, 'type':'list'},
             aws_secret_key={'default': None, 'aliases': ['ec2_secret_key', 'secret_key'], 'no_log': True},
             aws_access_key={'default': None, 'aliases': ['ec2_access_key', 'access_key']},
             region={'default': None, 'required': False, 'aliases':['aws_region', 'ec2_region'], 'choices':AWS_REGIONS}
@@ -230,16 +230,16 @@ def main():
             region = os.environ['EC2_REGION']
 
     if not region:
-        module.fail_json(msg = str("Either region or EC2_REGION environment variable must be set."))
+        module.fail_json(msg=str("Either region or EC2_REGION environment variable must be set."))
 
     instance_id = module.params['instance_id']
     elb_man = ElbManager(module, instance_id, ec2_elbs, aws_access_key,
                          aws_secret_key, region=region)
 
-    for elb in [ ec2_elbs ]:
+    for elb in ec2_elbs:
         if not elb_man.exists(elb):
-            str="ELB %s does not exist" % elb
-            module.fail_json(msg=str)
+            msg="ELB %s does not exist" % elb
+            module.fail_json(msg=msg)
 
     if module.params['state'] == 'present':
         elb_man.register()

Even with the above, I'm getting a hang after registering an instance into the ELB:

PLAY [all] ******************************************************************** 
GATHERING FACTS *************************************************************** 
ok: [ec2-******.compute-1.amazonaws.com]
TASK: [Gathering ec2 facts] *************************************************** 
ok: [ec2-******.compute-1.amazonaws.com]
TASK: [Register instance with ELB] ******************************************** 

The instance is registered into the ELB according to the EC2 console.

@jimi-c

jimi-c commented Aug 23, 2013

Copy link
Copy Markdown
Member

Did some testing on this today with at least the ec2 and ec2_elb module, which seem solid. @lwade, have you been able to do any testing on this yet?

@jimi-c

jimi-c commented Aug 23, 2013

Copy link
Copy Markdown
Member

Making a note regarding #3849 so I remember to close that once this gets merged in.

@lwade

lwade commented Aug 23, 2013

Copy link
Copy Markdown
Contributor

Hey James. I've tested the ec2_vol and s3 modules with these changes, both
are fine.

On that note, not sure why but this PR seems to be referencing: A
library/cloud/s3.orighttps://github.com//pull/3894/files#diff-8(473)?

On 23 August 2013 19:48, James Cammarata [email protected] wrote:

Did some testing on this today with at least the ec2 and ec2_elb module,
which seem solid. @lwade https://github.com/lwade, have you been able
to do any testing on this yet?


Reply to this email directly or view it on GitHubhttps://github.com//pull/3894#issuecomment-23183394
.

@lwade

lwade commented Aug 23, 2013

Copy link
Copy Markdown
Contributor

Note that the AWS API can be very slow here. Did it work out in the end?

On 23 August 2013 18:28, James Cammarata [email protected] wrote:

I've found a couple of problems with the ec2_elb module already:

diff --git a/library/cloud/ec2_elb b/library/cloud/ec2_elb
index a8131c2..a946f41 100644
--- a/library/cloud/ec2_elb
+++ b/library/cloud/ec2_elb
@@ -196,7 +196,7 @@ def main():
state={'required': True,
'choices': ['present', 'absent']},
instance_id={'required': True},

  •        ec2_elbs={'default': None, 'required': False},
    
  •        ec2_elbs={'default': None, 'required': False, 'type':'list'},
         aws_secret_key={'default': None, 'aliases': ['ec2_secret_key', 'secret_key'], 'no_log': True},
         aws_access_key={'default': None, 'aliases': ['ec2_access_key', 'access_key']},
         region={'default': None, 'required': False, 'aliases':['aws_region', 'ec2_region'], 'choices':AWS_REGIONS}
    

    @@ -230,16 +230,16 @@ def main():
    region = os.environ['EC2_REGION']

    if not region:

  •    module.fail_json(msg = str("Either region or EC2_REGION environment variable must be set."))
    
  •    module.fail_json(msg=str("Either region or EC2_REGION environment variable must be set."))
    

    instance_id = module.params['instance_id']
    elb_man = ElbManager(module, instance_id, ec2_elbs, aws_access_key,
    aws_secret_key, region=region)

  • for elb in [ ec2_elbs ]:

  • for elb in ec2_elbs:
    if not elb_man.exists(elb):

  •        str="ELB %s does not exist" % elb
    
  •        module.fail_json(msg=str)
    
  •        msg="ELB %s does not exist" % elb)
    
  •        module.fail_json(msg=msg)
    

    if module.params['state'] == 'present':
    elb_man.register()

Even with the above, I'm getting a hang after registering an instance into
the ELB:

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [ec2-******.compute-1.amazonaws.com]

TASK: [Gathering ec2 facts] ***************************************************
ok: [ec2-******.compute-1.amazonaws.com]

TASK: [Register instance with ELB] ********************************************

The instance is registered into the ELB according to the EC2 console.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3894#issuecomment-23178365
.

@jimi-c

jimi-c commented Aug 23, 2013

Copy link
Copy Markdown
Member

It was waiting for the service to come online, but since I hadn't setup an http server on the image that never happened. I had Bruce add a flag to tell it not to wait. Ideally there should also be a timeout so it doesn't wait forever but that's a future feature.

@jimi-c
jimi-c merged commit 80ddb1a into ansible:devel Aug 24, 2013
@jimi-c

jimi-c commented Aug 24, 2013

Copy link
Copy Markdown
Member

And merged! Thanks!

@bpennypacker
bpennypacker deleted the rb2 branch August 28, 2013 13:26
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature This issue/PR relates to a feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants