Hi,
I’ve just clean installed ansible 1.3.2 from rquillo’s PPA on my Ubuntu 12.04 system.
I created a playbook file (ansible-ec2.yml) with the following contents from the ec2 module documentation:
Launch instances, runs some tasks
and then terminate them
- name: Create a sandbox instance
hosts: localhost
gather_facts: False
vars:
keypair: langfords
instance_type: m1.small
security_group: sg-1edd3571
image: ami-c7c0d6b3
region: eu-west-1
tasks: - name: Launch instance
local_action: ec2 keypair={{ keypair }} group={{ security_group }} instance_type={{ instance_type }} image={{ image }} wait=true region={{ region }}
register: ec2 - name: Add new instance to host group
local_action: add_host hostname={{ item.public_ip }} groupname=launched
with_items: ec2.instances - name: Wait for SSH to come up
local_action: wait_for host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started
with_items: ec2.instances
And my /etc/ansible/hosts has a single entry:
localhost ansible_connection=local
I run this and it fails. Similar posts on this list suggest I have out of date modules, but I don’t know where these might be or how they might have got there?
langfords@langfords4$ ansible-playbook ansible-ec2.yaml -vvvv
PLAY [Create a sandbox instance] **********************************************
TASK: [Launch instance] *******************************************************
<127.0.0.1> EXEC [‘/bin/sh’, ‘-c’, ‘mkdir -p $HOME/.ansible/tmp/ansible-1381143657.34-222947650962172 && chmod a+rx $HOME/.ansible/tmp/ansible-1381143657.34-222947650962172 && echo $HOME/.ansible/tmp/ansible-1381143657.34-222947650962172’]
<127.0.0.1> REMOTE_MODULE ec2 keypair=langfords group=sg-1edd3571 instance_type=m1.small image=ami-c7c0d6b3 wait=true region=eu-west-1
<127.0.0.1> PUT /tmp/tmpocPJSL TO /home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ec2
<127.0.0.1> EXEC [‘/bin/sh’, ‘-c’, ‘/usr/bin/python /home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ec2; rm -rf /home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ >/dev/null 2>&1’]
failed: [localhost] => {“failed”: true, “parsed”: false}
invalid output was: Traceback (most recent call last):
File “/home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ec2”, line 1549, in
main()
File “/home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ec2”, line 612, in main
(instance_dict_array, new_instance_ids, changed) = create_instances(module, ec2)
File “/home/langfords/.ansible/tmp/ansible-1381143657.34-222947650962172/ec2”, line 437, in create_instances
res = ec2.run_instances(**params)
TypeError: run_instances() got an unexpected keyword argument ‘instance_profile_name’
FATAL: all hosts have already failed – aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/langfords/ansible-ec2.yaml.retry
localhost : ok=0 changed=0 unreachable=0 failed=1