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 On Saturday, April 5, 2014 4:07:56 AM UTC+10, Michael DeHaan wrote: > > 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" > > > On Fri, Apr 4, 2014 at 2:07 PM, Michael DeHaan > <[email protected]<javascript:> > > wrote: > >> We should either add the region parameter as universally required or >> provide sensible defaults. >> >> Please do file a bug on this. >> >> Thanks! >> >> >> On Fri, Apr 4, 2014 at 12:36 PM, i iordanov <[email protected]<javascript:> >> > wrote: >> >>> 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 >>> >>> On Fri, Apr 4, 2014 at 11:44 AM, benno joy <[email protected]<javascript:>> >>> wrote: >>> > >>> > Can you try passing "region: foo" as a parameter and see if that helps. >>> > >>> > >>> > >>> > >>> > On Fri, Apr 4, 2014 at 8:57 PM, i iordanov >>> > <[email protected]<javascript:>> >>> wrote: >>> >> >>> >> 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 >>> >> >>> >> On Fri, Apr 4, 2014 at 11:20 AM, Michael DeHaan >>> >> <[email protected]<javascript:> >>> > >>> >> wrote: >>> >> > 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. >>> >> > >>> >> > >>> >> > >>> >> > On Fri, Apr 4, 2014 at 11:17 AM, i iordanov >>> >> > <[email protected]<javascript:>> >>> wrote: >>> >> >> >>> >> >> 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. >>> >> >> >>> >> >> =================================================== >>> >> >> name: Start load-balancers >>> >> >> ec2_elb_lb: >>> >> >> aws_access_key: "{{ ec2_access_key }}" >>> >> >> aws_secret_key: "{{ ec2_secret_key }}" >>> >> >> name: "test-please-delete" >>> >> >> state: present >>> >> >> zones: >>> >> >> - us-east-1a >>> >> >> - us-east-1d >>> >> >> listeners: >>> >> >> - protocol: http # options are http, https, ssl, tcp >>> >> >> load_balancer_port: 80 >>> >> >> instance_port: 80 >>> >> >> =================================================== >>> >> >> >>> >> >> When ansible gets to this task, it hangs for a while and then >>> reports >>> >> >> the >>> >> >> following error. Since the error occurs in python-httplib2, I tried >>> >> >> updating >>> >> >> it from 0.7 (Debian wheezy) to 0.8 (Debian testing), but that >>> didn't >>> >> >> help >>> >> >> either: >>> >> >> >>> >> >> TASK: [Start load-balancers] >>> >> >> ************************************************** >>> >> >> failed: [localhost] => {"failed": true, "parsed": false} >>> >> >> invalid output was: Traceback (most recent call last): >>> >> >> File >>> >> >> >>> >> >> >>> "/root/.ansible/tmp/ansible-tmp-1396624105.37-127079892448911/ec2_elb_lb", >>> >> >> line 1880, in <module> >>> >> >> main() >>> >> >> File >>> >> >> >>> >> >> >>> "/root/.ansible/tmp/ansible-tmp-1396624105.37-127079892448911/ec2_elb_lb", >>> >> >> line 503, in main >>> >> >> aws_secret_key, region=region) >>> >> >> File >>> >> >> >>> >> >> >>> "/root/.ansible/tmp/ansible-tmp-1396624105.37-127079892448911/ec2_elb_lb", >>> >> >> line 210, in __init__ >>> >> >> self.elb = self._get_elb() >>> >> >> File >>> >> >> >>> >> >> >>> "/root/.ansible/tmp/ansible-tmp-1396624105.37-127079892448911/ec2_elb_lb", >>> >> >> line 266, in _get_elb >>> >> >> elbs = self.elb_conn.get_all_load_balancers() >>> >> >> File "/usr/lib/python2.7/dist-packages/boto/ec2/elb/__init__.py", >>> >> >> line >>> >> >> 124, in get_all_load_balancers >>> >> >> [('member', LoadBalancer)]) >>> >> >> File "/usr/lib/python2.7/dist-packages/boto/connection.py", line >>> >> >> 1143, >>> >> >> in get_list >>> >> >> response = self.make_request(action, params, path, verb) >>> >> >> File "/usr/lib/python2.7/dist-packages/boto/connection.py", line >>> >> >> 1089, >>> >> >> in make_request >>> >> >> return self._mexe(http_request) >>> >> >> File "/usr/lib/python2.7/dist-packages/boto/connection.py", line >>> 922, >>> >> >> in >>> >> >> _mexe >>> >> >> request.body, request.headers) >>> >> >> File "/usr/lib/python2.7/httplib.py", line 962, in request >>> >> >> self._send_request(method, url, body, headers) >>> >> >> File "/usr/lib/python2.7/httplib.py", line 996, in _send_request >>> >> >> self.endheaders(body) >>> >> >> File "/usr/lib/python2.7/httplib.py", line 958, in endheaders >>> >> >> self._send_output(message_body) >>> >> >> File "/usr/lib/python2.7/httplib.py", line 818, in _send_output >>> >> >> self.send(msg) >>> >> >> File "/usr/lib/python2.7/httplib.py", line 780, in send >>> >> >> self.connect() >>> >> >> File "/usr/lib/python2.7/dist-packages/boto/https_connection.py", >>> >> >> line >>> >> >> 111, in connect >>> >> >> sock.connect((self.host, self.port)) >>> >> >> File "/usr/lib/python2.7/socket.py", line 224, in meth >>> >> >> return getattr(self._sock,name)(*args) >>> >> >> socket.gaierror: [Errno -2] Name or service not known >>> >> >> >>> >> >> >>> >> >> FATAL: all hosts have already failed -- aborting >>> >> >> >>> >> >> PLAY RECAP >>> >> >> >>> ******************************************************************** >>> >> >> >>> >> >> Many Thanks! >>> >> >> iordan >>> >> >> >>> >> >> -- >>> >> >> 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] <javascript:>. >>> >> >> >>> >> >> To post to this group, send email to >>> >> >> [email protected]<javascript:> >>> . >>> >> >> To view this discussion on the web visit >>> >> >> >>> >> >> >>> https://groups.google.com/d/msgid/ansible-project/476a6c16-fec2-42b0-970c-f3e3754c2d2f%40googlegroups.com >>> . >>> >> >> For more options, visit https://groups.google.com/d/optout. >>> >> > >>> >> > >>> >> > -- >>> >> > You received this message because you are subscribed to a topic in >>> the >>> >> > Google Groups "Ansible Project" group. >>> >> > To unsubscribe from this topic, visit >>> >> > >>> >> > >>> https://groups.google.com/d/topic/ansible-project/dUQ0OpTkLBs/unsubscribe >>> . >>> >> > To unsubscribe from this group and all its topics, send an email to >>> >> > [email protected] <javascript:>. >>> >> > To post to this group, send email to >>> >> > [email protected]<javascript:> >>> . >>> >> > To view this discussion on the web visit >>> >> > >>> >> > >>> https://groups.google.com/d/msgid/ansible-project/CAEVJ8QPu%3DncFtGS-fA%3DjjipVFF3b7GeKRQTDhuVx%3D0MG_ecKYA%40mail.gmail.com >>> . >>> >> > >>> >> > For more options, visit https://groups.google.com/d/optout. >>> >> >>> >> >>> >> >>> >> -- >>> >> The conscious mind has only one thread of execution. >>> >> >>> >> -- >>> >> 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] <javascript:>. >>> >> To post to this group, send email to >>> >> [email protected]<javascript:> >>> . >>> >> To view this discussion on the web visit >>> >> >>> https://groups.google.com/d/msgid/ansible-project/CAMS0tn2LoSZS7nHeTL1UOVXqLq4ZtFrUXDFHHpOP9R85_KtxkA%40mail.gmail.com >>> . >>> >> >>> >> For more options, visit https://groups.google.com/d/optout. >>> > >>> > >>> > -- >>> > You received this message because you are subscribed to a topic in the >>> > Google Groups "Ansible Project" group. >>> > To unsubscribe from this topic, visit >>> > >>> https://groups.google.com/d/topic/ansible-project/dUQ0OpTkLBs/unsubscribe >>> . >>> > To unsubscribe from this group and all its topics, send an email to >>> > [email protected] <javascript:>. >>> > To post to this group, send email to >>> > [email protected]<javascript:> >>> . >>> > To view this discussion on the web visit >>> > >>> https://groups.google.com/d/msgid/ansible-project/CAFUV_d5GhvVY9v6GwJOXwZOsiWHcsYa_pfE5Up39-q_n9o1p9w%40mail.gmail.com >>> . >>> > >>> > For more options, visit https://groups.google.com/d/optout. >>> >>> >>> >>> -- >>> The conscious mind has only one thread of execution. >>> >>> -- >>> 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] <javascript:>. >>> To post to this group, send email to >>> [email protected]<javascript:> >>> . >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/CAMS0tn01pgPqnv0gY_uUF4YjMgxxmkKh8Xz_An8uLi4LiwtkQg%40mail.gmail.com >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > -- 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/3329ab03-d404-4c8a-8dfc-2362733b375c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
