Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a clean environment for your ansible setup

    Code Block
    languagebash
    linenumberstrue
    vagrant init ubuntu/trusty64
    vagrant up && vagrant ssh
  2. Create an ssh key for that instance 

    Code Block
    languagebash
    linenumberstrue
    cd ~/.ssh
    ssh-keygen -t rsa -b 4096 -C "maurya@openmrs.org" -f id_rsa
  3. 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
    languagebash
    linenumberstrue
    cat id_ansible.pub | pbcopy  
  4. Add ansible ppa and update cache and install ansible on that machine

    Code Block
    languagebash
    linenumberstrue
    sudo add-apt-repository ppa:ansible/ansible
    sudo apt-get update
    sudo apt-get install -y ansible
  5. Configure ansible hosts file file and add your hosts/servers you would like to manage using ansible to this file

    Code Block
    languagebash
    linenumberstrue
    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
  6. Setting up Git

    Code Block
    languagebash
    linenumberstrue
    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
  7.