ANSIBLE
What is Ansible ?
• Ansible is an open-source con guration management and provisioning tool, similar to
  Chef, Puppet or Salt.
• It uses SSH to connect to servers and run the con gured Tasks. Ansible lets you control
  and con gure nodes from a single machine
• What makes it di erent from other management software is that Ansible uses SSH
  infrastructure. The project was founded in 2013 and bought by Red Hat in 2015.
    fi
              ff
                           fi
                                             fi
                                 Why Ansible ??
• No Agent - As long as the box can be ssh’d into and it has Python, it can be con gured with
  Ansible.
• Idempotent - Ansible’s whole architecture is structured around the concept of idempotency. The
  core idea here is that you only do things if they are needed and that things are repeatable
  without side e ects.
• Declarative Not Procedural - Other con guration tools tend to be procedural: do this and then
  do that and so on. Ansible works by you writing a description of the state of the machine that
  you want and then it takes steps to ful ll that description.
• Tiny Learning Curve - Ansible is quite easy to learn. It doesn’t require any extra knowledge.
         ff
                                  fi
                                       fi
                                                                              fi
                                         Ansible Usecases
          • Provisioning - Setting up servers and environments from scratch with the necessary software and
            con gurations.
          • Con guration Management - Managing and maintaining consistent con guration across servers.
          • App Deployment - Deploying applications in a consistent and repeatable manner.
          • Continuous Delivery - Automating the release of software updates and ensuring they are deployed
            smoothly.
          • Security & Compliance - Ensuring systems are secure and compliant with industry standards and
            policies.
          • Orchestration - Coordinating and managing complex work ows and operations across multiple systems.
fi
     fi
                                                           fl
                                                                        fi
                                           Playbook
• Ansible Playbooks are YAML les that de ne a series of tasks to be executed on remote nodes,
  written in a simple and human-readable format.
• They ensure tasks are idempotent, meaning they can be run multiple times without altering the
  system state beyond the initial execution.
• Playbooks support modularity through reusable roles and tasks, making complex con gurations
  manageable.
• They can orchestrate tasks across multiple machines, making them ideal for multi-tier
  deployments, and can be easily version-controlled using systems like Git.
                          fi
                                      fi
                                                                                 fi
                                           Inventory
• Ansible Inventory is a le that de nes the hosts and groups of hosts upon which Ansible
  commands, modules, and playbooks operate.
• It can be written in plain text, INI, or YAML formats and supports dynamic inventory scripts that
  can pull data from external sources.
• The inventory le allows for organizing hosts into groups, enabling targeted execution of tasks
  and con gurations.
• It also supports variable assignment at both the host and group level, providing exibility in
  managing di erent environments and con gurations.
    fi
         ff
              fi
                   fi
                             fi
                                      fi
                                                                             fl
                                          Modules
• Ansible Modules are reusable, standalone scripts that perform speci c tasks such as installing
  packages, managing services, or handling les on remote hosts.
• They are the building blocks of Ansible playbooks and can be executed individually or as part
  of a larger playbook.
• Modules are written in Python and support a wide range of functionalities, enabling
  automation of complex IT tasks.
• They ensure idempotency, meaning they only make changes if the current state does not
  match the desired state, preventing unintended alterations.
                                     fi
                                                                fi