Ansible and AWS

42 views
Skip to first unread message

Stefano

unread,
Oct 21, 2015, 9:06:39 AM10/21/15
to Ansible Project
Hi,
i'm new to ansible, i have read the book "Ansible Up and running" by L. Hochstein. I'm considering ansible as an alternative to puppet. From the book seems ansible can launch commands from a client to other machines, i would launch an ami istance and provisioning directly from user data, without intervention of any client, i can get the configuration files of ansible from S3 and running to itself?

Thanks

Stephen Granger

unread,
Oct 21, 2015, 1:50:56 PM10/21/15
to ansible...@googlegroups.com
Hi Stefano,

it's possible to use cloud init to install ansible and then download and install ansible playbooks from s3.

e.g. 
runcmd:
 - yum clean all
 - yum install --enablerepo=epel -y gcc python27 python27-devel python27-pip python27-boto libselinux-python aws-cli 
 - /usr/bin/pip-2.7 install --upgrade pip-2.7
 - alternatives --set python /usr/bin/python2.7
 - /usr/bin/pip-2.7 install --upgrade ansible
 - mkdir /etc/ansible
 - aws s3 cp s3://my_bucket/ansible /etc/ansible/ --recursive
 - echo localhost > /etc/ansible/hosts
 - /usr/local/bin/ansible-playbook /etc/ansible/playbook.yml -i /etc/ansible/hosts

Is this what you are wanting to do?

--
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/6d30476c-b702-4a56-8c47-9e1b21a013f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve
Reply all
Reply to author
Forward
0 new messages