ec2_elb_lb module fails with trivial example

Hello!

I may be doing something wrong, but I tried so many different things, I though it should report just in case. So far, I’ve tried Ansible 1.5 built from the repository and from Debian testing, and Ansible 1.6 (build from today’s devel branch state). Also, I’ve tried with python-boto 2.9.x (from Ubuntu Saucy), 2.25 (Debian testing), and 2.27 (Debian unstable). The platform I’m running on is Debian Wheezy because I wanted everything else to be rock-solid.

I’ve tried simplifying my DNS settings to just leaving “nameserver 8.8.8.8” just in case it was a DNS issue.

Here is the absolutely trivial ec2_elb_lb configuration that fails and the error it fails with. This is the example almost straight out of the online manual. I started with a much more complicated config and eventually decided to trivialize it to see if the error still recurs, and indeed it does.

There have been some tickets open about ec2_elb recently:

Please review the following and see if your issues are addressed by the latest on the development branch:

https://github.com/ansible/ansible/search?q=ec2_elb&ref=cmdform&type=Issues

If not and you are still seeing issues on the development branch, please open a new ticket.

Hi Michael,

I just built Ansible from the latest devel branch and I'm still seeing
the same error. I don't quite understand whether I need to patch the
devel branch with anything before testing.

If not, I've already tested with the latest devel branch and this is a new bug.

Thanks!
iordan

Can you try passing “region: foo” as a parameter and see if that helps.

Hi Benno,

Thanks, that did help. Now I get further. So this is a documentation issue.

Now I am suffering from a lack of a feature which is a different
issue. With the current code, I am unable to place the ELB into a VPC
which is necessary for my use-case.

Cheers!
iordan

We should either add the region parameter as universally required or provide sensible defaults.

Please do file a bug on this.

Thanks!

I didn’t mean defaults – I mean “we should set this as universally required because we can’t provide sensible defaults, or at least when the module needs it”

Actually, that’s not entirely true.

The connect_to_aws and connect_to_ec2 methods both use the get_aws_connection_info under the hood, which checks EC2_REGION, AWS_REGION, module.params[‘region’] and boto config’s region before giving up and returning None (at which point the calling module should probably fail)
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/ec2.py

The problem is that the ELB modules have yet to be rewritten to use the common code, but I’d probably favour that over mandating that region be provided.

Will

https://github.com/ansible/ansible/pull/6914 should fix this (requires 6913 to be accepted too)

Will

Yeah send us a PR?

Thanks!

You replied to my message referencing my PR.

Hope the PR is satisfactory :slight_smile:

Will