Ansible uses ssh for all linux connections and winrm for windows connections. See ssh for basic ssh setup.
See http://docs.ansible.com/intro_installation.html.
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
If you want to target windows you will also need to install the following:
sudo apt-get install -y python-pip
pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
You will also need to make sure the windows machine is properly prepped.
See https://github.com/majorsilence/DotNetDev/tree/master/DevOps/Ansible for examples.
See https://github.com/majorsilence/DotNetDev/tree/master/DevOps/Ansible for examples.
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.
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@192.168.40.4
If you get the remote host identifcation has changed warning, remove the host with the following command.
ssh-keygen -R 192.168.40.4
Obviously replacing the IP with the IP of your virtual machine.