1. Yeuk Hon Wong
  2. ansible-demo



Ansible: Get Ya' Work done in 15 mins

Speaker: Yeuk Hon Wong (yeukhon@acm.org)

This talk was given at NYC-Python on May 7th.

Presentation: Ansible: Get Ya' Work Done in 15-minute

Previous Talk: Deploying with Vagrant and Ansible

Practical playbook: repo-api

Getting Started

You can do this against any server (EC2, local Vagrant, or personal OS).

Install Ansible:

sudo pip install ansible

Next, clone down this playbook on your local machine:

hg clone https://bitbucket.org/yeukhon/ansible-demo
cd ansible-demo/playbooks

Then, if you want to run the Ansible playbook against a remote server, just edit hosts file to give the ip/domain. We ship with so you can also run this against your localhost machine. In fact, you can run this directly on the remote server using

Finally, to actually run provisioning, you need a command like:

ansible-playbook -i <host-file-name> <master-playbook> [--options]

For example, if host-file-name is hosts, the entry point of the playbook is webserver.yml and we want to use private-key to log in, we can run:

ansible-playbook -i hosts webserver.yml --private-key /path/to/private-key

If you want to run with password:

ansible-playbook -i hosts webserver.yml -u username -k -K

where -u is the username you want to SSH into, -k is the SSH user password, and -K is the password for sudo (since we run certain tasks with sudo, such as apt-get).

You can learn more from other links above.