Ansible is a tool for managing remote computers via secure shell (ssh). This quick how-to is based on the Ansible Installation page.
Installation
To install Ansible on Debian Mint:
- If you don’t have pip installed, run: sudo easy_install pip
- Run: sudo pip install paramiko PyYAML Jinja2 httplib2 six
- Install Ansible by running: sudo pip install ansible
- Run: sudo mkdir /etc/ansible
- Run: sudo vim /etc/ansible/hosts
- Insert the following lines (replacing the example host with the hosts you want to manage):
[webservers] ec2-54-186-136-60.us-west-2.compute.amazonaws.com
Writing Scripts
Ansible has its own weird YAML (yet another markup language) based scripting language for writing programs called playbooks (see the Intro to Playbooks). Create your script with a text editor, save it in a file (e.g. playbook.yml), and run it with:
ansible-playbook playbook.yml