1. Download virtualbox
  2. Download vagrant
  3. Vagrantfile: Change config.vm.box = "ubuntu/trusty64", to set ubuntu server of your choice.
  4. Commands:
    vagrant up To boot vagrant environment and now we have virtual machine running Ubuntu
    vagrant ssh to ssh into machine
  5. To change default key:
    ssh-keygen —> generate a new key pair (let's say vagrant and vagrant.pub)
    Vagrantfile: add the config.ssh.private_key_path = ["~/vagrant"]
    Do vagrant ssh
  6. Check vagrant config file vagrant ssh-config, make a note of default ip, port and the ssh it is using.
  7. Ansible install: pip install ansible --user.. sometimes this ansible says command not found..
    for this, export PATH="~/Library/Python/2.7/bin:$PATH" (we can add this to ~/.bash_profile to make it permanent)
  8. hosts file with ( default ip and port of vagrant)
    install_nginx.yml with codes to install ngnix
    and ansible-playbook command: ansible-playbook --private-key=~/vagrant -u vagrant -i hosts filename.yml