Ansible: Get Ya' Work done in 15 mins
Speaker: Yeuk Hon Wong (firstname.lastname@example.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
You can do this against any server (EC2, local Vagrant, or personal OS).
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 127.0.0.1 so you can also run this against your localhost machine. In fact, you can run this directly on the remote server using 127.0.0.1.
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.