...
Create a clean environment for your ansible setup
Code Block language bash linenumbers true vagrant init ubuntu/trusty64 vagrant up && vagrant ssh
Create an ssh key for that instance
Code Block language bash linenumbers true cd ~/.ssh ssh-keygen -t rsa -b 4096 -C "maurya@openmrs.org" -f id_rsa
Copy the public key to be used for root user while creating a virtual box for ansible to do it's magic. The following is for copying the content into a mac clipboard. (You can still use cat to see the content and copy it over)
Code Block language bash linenumbers true cat id_ansible.pub | pbcopy
Add ansible ppa and update cache and install ansible on that machine
Code Block language bash linenumbers true sudo add-apt-repository ppa:ansible/ansible sudo apt-get update sudo apt-get install -y ansible
Configure ansible hosts file file and add your hosts/servers you would like to manage using ansible to this file
Code Block language bash linenumbers true sudo mv /etc/ansible/hosts /etc/ansible/hosts.bak sudo vim /etc/ansible/hosts
Example:
Code Block [test] xx.xx.xxx.xxx [production] example.hello.com
Setting up Git
Code Block language bash linenumbers true sudo apt-get install git git config --global user.email "youremailid" git config --global user.name "youreusername" git config --global core.editor "vim" git config --global push.default simple git --version