Ansible and AWS

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

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?