Problems provisioning a load balancer using the ec2_elb_lb module

310 views
Skip to first unread message

iain wright

unread,
May 29, 2014, 7:45:21 PM5/29/14
to ansible...@googlegroups.com
Hi folks,

I'm trying to provision an ELB in a VPC, this is the play im attempting, from the doc @ http://docs.ansible.com/ec2_elb_lb_module.html
---
- hosts: localhost
  connection
: local
  gather_facts
: False
  vars_files
:
 
- group_vars/ec2

  tasks
:
 
- name: Include the variables specific to the vpc
    include_vars
: envs/{{ env| default("dev") }}

 
# Basic VPC provisioning example
 
- local_action:
     
module: ec2_elb_lb
      name
: "test-vpc"
      zones
:
     
- us-west-1a
      scheme
: internal
      state
: present
      subnets
:
       
- subnet-04ee0161
      listeners
:
       
- protocol: http # options are http, https, ssl, tcp
          load_balancer_port
: 80
          instance_port
: 80

First I get this:
TASK: [ec2_elb_lb] ************************************************************
failed
: [localhost] => {"failed": true}
msg
: unsupported parameter for module: subnets

FATAL
: all hosts have already failed -- aborting

So i commented subnets out and get:
TASK: [ec2_elb_lb] ************************************************************
failed
: [localhost] => {"failed": true}
msg
: unsupported parameter for module: scheme

FATAL
: all hosts have already failed -- aborting

Then I comment out scheme and get:
TASK: [ec2_elb_lb] ************************************************************
failed
: [localhost] => {"failed": true, "parsed": false}
invalid output was
: Traceback (most recent call last):
 
File "/home/iain/.ansible/tmp/ansible-tmp-1401406900.33-179061245380748/ec2_elb_lb", line 1872, in <module>
    main
()
 
File "/home/iain/.ansible/tmp/ansible-tmp-1401406900.33-179061245380748/ec2_elb_lb", line 495, in main
    region
=region, **aws_connect_params)
 
File "/home/iain/.ansible/tmp/ansible-tmp-1401406900.33-179061245380748/ec2_elb_lb", line 188, in __init__
   
self.elb = self._get_elb()
 
File "/home/iain/.ansible/tmp/ansible-tmp-1401406900.33-179061245380748/ec2_elb_lb", line 249, in _get_elb
    elbs
= self.elb_conn.get_all_load_balancers()
AttributeError: 'NoneType' object has no attribute 'get_all_load_balancers'

FATAL
: all hosts have already failed -- aborting

Our vars/group vars files/variables are working well for provisioning ec2 instances

iain@iain-P15xEMx:~/Desktop/ansible$ ansible --version
ansible
1.6.1

Thanks!
-iain

James Martin

unread,
May 30, 2014, 12:07:50 PM5/30/14
to ansible...@googlegroups.com
Iain,

The subnet and scheme parameters are not available in ansible 1.6.1.  You'll need to run the development version of ansible available on github.  https://github.com/ansible/ansible.

- James

James Cammarata

unread,
May 30, 2014, 12:24:20 PM5/30/14
to ansible...@googlegroups.com
Have you upgraded from 1.5.x by any chance? If so, how did you do it? It seems like your getting an old version of the module somehow.


--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e5ed6fc7-bc14-4fa3-b248-22344ce5dc37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
May 31, 2014, 12:22:49 PM5/31/14
to ansible...@googlegroups.com
James, the docs say for subnet: "(added in Ansible 1.6)" and I don't see a label for scheme.

Please be sure to file a github ticket or amend the documentation block in the module if you think these are mislabelled.





--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

iain wright

unread,
Jun 4, 2014, 3:25:05 PM6/4/14
to ansible...@googlegroups.com
Hi James,

I've just created a new python virtualenv and installed ansible:
iain@iain-P15xEMx:~/Desktop/ansible$ mkvirtualenv ansible
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ pip install paramiko PyYAML jinja2 httplib2
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ pip install ansible
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ pip install boto
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ python -V
Python 2.7.5+
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ ansible --version
ansible 1.6.2

And am still getting the same set of errors, starting with subnet:
(ansible)iain@iain-P15xEMx:~/Desktop/ansible$ ansible-playbook deploy_elb.yml -e "env=prod"

PLAY [localhost] ************************************************************** 

TASK: [Include the variables specific to the vpc] ***************************** 
ok: [localhost]

TASK: [ec2_elb_lb] ************************************************************ 
failed: [localhost] => {"failed": true}
msg: unsupported parameter for module: subnets

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/iain/deploy_elb.retry

localhost                  : ok=1    changed=0    unreachable=0    failed=1   

Is there a better method of install? Do i need to track the dev github branch or anything?

Thank you,
iain

iain wright

unread,
Jun 4, 2014, 9:29:02 PM6/4/14
to ansible...@googlegroups.com
Just noticed subnets is in the devel branch but not the 1.6.2 in github, so looks like i just need to track dev for this! 

Thank you,
iain

James Cammarata

unread,
Jun 4, 2014, 9:32:28 PM6/4/14
to ansible...@googlegroups.com
Hi Iain, it does appear that this feature is included in the current development branch, so to use it you will need to clone the github repository and install it from that branch. We typically recommend users of the devel branch source the "hacking/env-setup" script, which makes it very simple to use.

I have updated the docs as well to reflect this.

Thanks!


Reply all
Reply to author
Forward
0 new messages