“Deploy apps. Manage systems. Crush complexity. Ansible helps you build a strong foundation for DevOps.”

Ansible uses ssh for all linux connections and winrm for windows connections. See ssh for basic ssh setup.

Ansible Install


Ubuntu install

sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible

Target Windows

If you want to target windows you will also need to install the following:

sudo apt-get install -y python-pip
pip install

You will also need to make sure the windows machine is properly prepped.

Create Playbook

See for examples.

Run Ansible

See for examples.

Various Configs

Ansible with Username

Not recommend. Use ssh keys instead.

Use the –ask-pass option to use username and password instead of ssh key.

ansible-playbook playbook.yml --ask-pass --user=TheUserName -i /path/to/hosts/file


-f 10 parallelism level of 10 servers at once. Replace 10 with however many servers to want to run at the same time.

Ansible SSH problems with Vagrant

For example you get the message. “”” FATAL: no hosts matched or all hosts have already failed – aborting “”” If you have already created the vm and destroyed it and recreated this is probably caused by a host idenfication change. SSH does not like it.

Test this out by running something like

ssh vagrant@

If you get the remote host identifcation has changed warning, remove the host with the following command.

ssh-keygen -R

Obviously replacing the IP with the IP of your virtual machine.