DEV Community

loading...
Cover image for Automated configuration management using RedHat Ansible

Automated configuration management using RedHat Ansible

Rajit Paul
Experienced in working with different technologies and integrating them to find the optimal solution for a challenge. AWS | DevOps | ML | DL | Mobile-Dev
・3 min read

About RedHat:

Red Hat, Inc. is an American multinational software company that is the world's leading provider of enterprise open source solutions.


Alt Text

About Ansible:

Ansible is an open source configuration management, and application-deployment tool that ends repetitive tasks and frees up DevOps teams for more strategic work.
Alt Text

Installing Ansible

    ‣ Ansible is agentless

    So, we need to install ansible only on the Controller Node.

    Ways to install Ansible
  • pip3 install ansible
  • [ Python3 installed on Control Node ]

  • yum installed ansible
  • [ Pre configured yum with additional epel repo ]

    Ansible Architecture

    • Controller Node~
    • Controller Node also referred to as Master Node as the name suggests is the epitome of the Ansible architecture and this is where we run the tasks and playbooks.

    • Managed Node~
    • Managed Nodes are the worker nodes that needs to be configured.

      Alt Text

      How does Ansible work:

      • Ansible Inventory~
      • - The inventory consists of the hosts that we want to configure.

      • Host User Authentication~
      • - We need to authenticate the user either with ssh-key or using the help of password authentication.

      • Ansible Configuration~
      • - The ansible.cfg file consists of the location of the inventory, and other necessary ansible parameters

        Sample GitHub ansible.cfg template

        Once we have a stable connectivity with the hosts we can proceed with the configurations

        Alt Text

        How do we automate the host configuration using ansible?

        • Ad-Hoc Commands~
        • Ansible Ad-Hoc Commands uses the /usr/bin/ansible command line tool to automate a singletask on the Managed hosts. ansible hostgroup/ip -m module

          What are Modules?

          Ansible Modules are standalone scripts that can be used by the Ansible API or Playbooks Programs

          List of all the ansible modules
        • Ansible Playbooks~
        • Ansible Playbooks are blueprints of automation tasks, which record and execute Ansible's configuration, deployment and orchestartion function.

          What are Ansible Roles?

          Ansible Roles lets us automatically load variables, tasks, handlers and other Ansible artifacts based on a known file structure. Roles Hierarchy ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jayufc7s2imo3qp97ikd.png)

          Integrations Using Ansible

          Splunk

          Many of today's top organizations are using Splunk & Ansible.

          Splunk and ansible are complimentary to each other.

          Using Ansible Tower built in logging integrations we can pass our ops data describing our infrastructure from Ansible Tower to Splunk.

          Alt Text
          Other integrations include Microsoft Azure, AWS, GCP ....
          source: Redhat(https://www.redhat.com/en), Ansible(https://www.ansible.com/)
          Thanks for reading ⚡⚡

Discussion (0)