---
#- name: Create Launch Configuration
# hosts: localhost
# gather_facts: no
# tasks:
- name: Launch the configurations for the ASG
local_action:
module: ec2_lc
state: present
assign_public_ip: yes
name: elasticsearchlaunchconfiguration16
instance_type: m3.medium
key_name: tempkey1
instance_monitoring: yes
region: us-east-1
image_id: ami-fce3c696
security_groups: ['sg-1234abcd']
user_data: "#!/bin/bash\n
# Update repositories\n
sudo apt-get update\n
sudo apt-get install -y python-setuptools\n
sudo apt-get install -y python-pip\n
sudo apt-get install -y python-dev\n
sudo pip install markupsafe\n
sudo pip install jinja2\n
sudo pip install boto\n
sleep 1\n
sudo apt-get install -y git\n
sudo pip install ansible==1.8.4\n
sudo apt-get -y update\n
cd /home\n
git clone https://github.com/abcdedfg/ansibleconfig.git\n
cd ansibleconfig\n
sudo wget https://s3.amazonaws.com/automation/cred-aws\n
sudo wget https://s3.amazonaws.com/automation/key1.pem\n
. ./cred-aws\n
sudo chmod 400 key1.pem\n
export ANSIBLE_HOST_KEY_CHECKING=False\n
ansible-playbook -i hosts main.yml\n
sudo apt-get -y update"