PermalinkAnsible
Ansible is an Open Source tool that automates deployments, orchestration and cloud provisioning. It uses playbooks to execute commands that are written in a human-readable language called YAML.
With Ansible, users can easily define infrastructure as code, making it easy to manage and track changes over time. Ansible also supports a wide range of platforms and operating systems, making it a versatile tool that can be used to automate tasks across multiple environments.
PermalinkFeatures
Agentless - No Agent Installation is needed.
Feature Rich - Built on Python.
Secure - Uses SSH.
Push-Based Architecture - Changes can be pushed all at once simultaneously.
PermalinkAnsible Architecture
Users: Those who are responsible for creating Ansible Playbooks and have a connection with the Ansible automation engine.
Playbooks: A set of commands to be executed on either one or many hosts. Generally used to automate repetitive tasks.
Inventory: List of IP addresses of all the hosts.
Modules: A reusable piece of code that performs a specific task such as installing packages, creating users, copying files, and running commands on a remote host.
API's: Collection of programming interfaces that allow Ansible to be used as an automation engine from other software applications or systems.
Plugins: A piece of code that extends or modifies Ansible's core functionality. Plugins can be used to customize or extend Ansible's behavior, or to add new features and capabilities to the tool.
CMDB (Configuration Management DataBase): It is a database that stores information about the configuration items.
Hosts: They refer to the machines like Linux or Unix machines which are getting automated using Ansible.
PermalinkUsed in
App Deployment
Orchestration
Configuration Management
Provisioning
Security and Compliance
PermalinkSample Playbook
The following is a sample playbook to install Apache2.
---
- name: Install Apache
hosts: all
become: true
tasks:
- name: Update apt cache
apt:
update_cache: yes
- name: Install Apache
apt:
name: apache2
state: present
- name: Start Apache
service:
name: apache2
state: started
enabled: true
---
PermalinkInstalling Ansible
After getting a brief introduction to Ansible, if you do wish to install it, then you can follow the commands to do so.
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get-repository ppa: ansible/ansible
sudo apt-get update
sudo apt-get install ansible
PermalinkResources
PermalinkConclusion
That was it for this Blog post, if you liked it then please be sure to like and comment. Check out my socials and dm me for any feedback.
Support me by Sponsoring me, if you like my content and blog posts.
Subscribe to my newsletter to be up-to-date with my new blogs