Versions Compared

Key

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

...

Ansible provides support for managing multiple servers and getting them to a desired state. For packaging OHIE purpose ansible is used as a user management service. Ansible connects using SSH and needs an environment setup.

  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 

    Code Block
    languagebash
    linenumberstrue
    sudo mv /etc/ansible/hosts /etc/ansible/hosts.bak
    sudo vim /etc/ansible/hosts