Code Monkey home page Code Monkey logo

opensourceproject-productiongradeansibleenviornment's Introduction

Set up of a real time production scenario of various Linux hosts (distros) which can be managed centrally with Ansible Master. Test the set-up by running modules and playbooks.

  • Below topology would be created.
    image

  • Instal virtual box and download latest versions (64bit) of Debian, Ubuntu & Cent OS VDI's from OS Box images for virtual box.

  • Follow the steps to install a host for each distro (debian, centos & ubuntu).

  • Follow the steps carefully to ensure internet access for all the VDI's. Ubuntu and Debian would work fine but CentOS might give issues and this video will resolve the problem. If the earlier video is followed then CentOS will also work fine. If not refer the second video.

  • For CentOS download the "Workstation" (not the server).

  • Password would be in the info tab.
    image

  • Start the servers and SSH into them (e.g. MobaXterm).

  • Make any one of the server as Ansible master and install Ansible.. Verify by running the command "ansible --version".

  • In Ansible master create any folder (e.g. ansible_test) and change directory to it (mkdir ansible_test & cd ansible_test).

  • Create file ansible.cfg and enter the below two commands.
    $ nano ansible.cfg
    image

  • Create a file "inventory.txt" in the folder created above and group your remote hosts as per OS and enter the login credentials in the ":vars" section as below. Change the IP addresses with your's. For sudo user password add "ansible_become_password".
    image

  • To check connectivity run the playbook ping_test.yaml with below command & the output will be similar to image below. Source code uploaded in this repository.
    $ ansible-playbook ping_test.yaml
    image

  • Connectivity can also be checked by running the below adhoc command and output would be like image below.
    image

  • To check OS releases of each remote hosts run the below ansible playbook and output will be similar to the image below (playbook source code uploaded).
    $ ansible-playbook os-release1.yaml image

  • OS release can also be checked by running the below adhoc command and the output will be as the image.
    $ ansible all -a "cat /etc/os-release"
    image

  • The enviornment set-up is now successful. The machines can be shut down from virtual box and restarted anytime later. More complex ansible automation tasks (e.g. patching the different servers automatically) can be performed in this set-up as it mimics a production environment with different linux distros.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.