Hi, I'm trying to associate AWS EC2 elastic IP address with instance but I'm getting the following error:
PLAY [EC2 instance] ***********************************************************
TASK: [allocate a new elastic IP and associate it with an instance] ***********
<localhost> REMOTE_MODULE ec2_eip instance_id=i-df641fa5 CHECKMODE=True
failed: [localhost] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-1386951606.06-256720336590639/ec2_eip", line 1368, in <module>
main()
File "/root/.ansible/tmp/ansible-1386951606.06-256720336590639/ec2_eip", line 283, in main
instance = find_instance(ec2, instance_id, module)
File "/root/.ansible/tmp/ansible-1386951606.06-256720336590639/ec2_eip", line 231, in find_instance
reservations = ec2.get_all_reservations(instance_ids=[instance_id])
AttributeError: 'EC2Connection' object has no attribute 'get_all_reservations'
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/root/ec2.retry
localhost : ok=0 changed=0 unreachable=0 failed=1
My play looks as follows:
- name: EC2 instance
hosts: local
connection: local
user: root
gather_facts: false
tasks:
- name: allocate a new elastic IP and associate it with an instance
ec2_eip: instance_id=i-df641fa5
register: eip
OS: Debian 7.2
Ansible version is 1.5
Can anybody help?
Thanks in advance.
What version of python-boto do you have installed?
2.3.0
Are you sure? boto 2.20.0 was only released yesterday.
Of course, boto version 2.3.0, not 2.30.0:
boto.Version
‘2.3.0’
I’ve already upgraded python-boto to the latest version 2.20.0 and everything works fine.
Thanks a lot for your help!
No problem. Glad you got it working!