Ansible - create limitless amount of instances from one ami

11 views
Skip to first unread message

Jaspis Praha

unread,
Mar 15, 2017, 10:23:27 AM3/15/17
to Ansible Project
Hi,

I created and configured my instance and I woud like to create thousands of the same instances from the original one. I manualy created an image (ami) from my original instance and I would like to use following playbook which should fro testing purposes create only 2 additional instances (requirments met: boto, exported access and secret keys):

---
- hosts: localhost
  connection: local
  gather_facts: True
  tasks:
       -name: create instances from ami
       ec2:
       instance_type: t2.micro
       image: ami-xxxxxxxx
       wait: yes
       group: xxxxxxxxxxx
       count: 2
       assign_public_ip: no

I am running this code form the original instance, and as a result I got nothing: no errors, no actions, just this:

$ansible-playbook ec2.yml -vvvv

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

GATHERING FACTS ***************************************************************
<localhost> REMOTE_MODULE setup
<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1489                                                      585887.35-241432469012233 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-148958588                                                      7.35-241432469012233 && echo $HOME/.ansible/tmp/ansible-tmp-1489585887.35-241432                                                      469012233']
<localhost> PUT /tmp/tmpdsMH2o TO /home/ubuntu/.ansible/tmp/ansible-tmp-14895858                                                      87.35-241432469012233/setup
<localhost> EXEC ['/bin/sh', '-c', '/usr/bin/python /home/ubuntu/.ansible/tmp/an                                                      sible-tmp-1489585887.35-241432469012233/setup; rm -rf /home/ubuntu/.ansible/tmp/                                                      ansible-tmp-1489585887.35-241432469012233/ >/dev/null 2>&1']
ok: [localhost]

PLAY RECAP ********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0
====================================
  
So what is missing?

jab
Reply all
Reply to author
Forward
0 new messages