0% found this document useful (0 votes)
5 views9 pages

Ansible Learning

Ansible is an open-source automation tool that simplifies tasks such as software installation and system updates across multiple computers using playbooks written in YAML. It consists of components like an inventory of managed hosts, modules for specific tasks, and plugins for additional features. The document also outlines the steps for setting up Ansible and creating a playbook for Apache installation, demonstrating its efficiency in automating server management.

Uploaded by

ak217207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

Ansible Learning

Ansible is an open-source automation tool that simplifies tasks such as software installation and system updates across multiple computers using playbooks written in YAML. It consists of components like an inventory of managed hosts, modules for specific tasks, and plugins for additional features. The document also outlines the steps for setting up Ansible and creating a playbook for Apache installation, demonstrating its efficiency in automating server management.

Uploaded by

ak217207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

What is Ansible?

Ansible is an open-source tool that helps you automate things like:

• Installing software
• Updating systems
• Managing many computers at once

You write simple instructions in a file (called a playbook) using easy-to-


read language (YAML), and ansible does the rest.

Think of it like:

Instead of doing the same task on 10 servers one by one, Ansible lets you
do it all at once with just one command!

Pawar Divya
1. Users
• These are the people (like you) who write Ansible Playbooks to define
what tasks should be automated.
2. Ansible Playbook
• A file written in YAML that contains step-by-step instructions for what
Ansible should do (e.g., install software, start a service).

Pawar Divya
3. CMDB & Cloud
• CMDB (Configuration Management Database) and cloud platforms (like
AWS, Azure, etc.) provide information about systems (like their IP
addresses, OS, etc.) to Ansible.
4. Ansible Automation Engine
This is the core of Ansible where all the action happens. It has several
components:
• Inventory: List of server or systems Ansible will manage (called
“hosts”).
• Modules: Small programs that do specific tasks like installing packages
or copying files.
• Plugins: Add extra features like logging or connecting to cloud
platforms.
• API: Allows Ansible to connect with other tools or systems.

Pawar Divya
5. Output (Target Systems)
Ansible performs actions on:
• Hosts (Servers): Like installing software, updating packages.
• Networking devices: like routers and switches.

Creating an Ansible Playbook for Apache Installation

As for the master-worker setup (referring to a control node and managed nodes in
an Ansible setup):

Steps for Master-Worker Setup

1. Install Ansible on the Control plane (Master)


• Update system: sudo apt update
• Install Ansible: sudo apt install ansible

Pawar Divya
2. Configure SSH Access
• Ensure passwordless SSH access from the control node (master) to the
worker node (managed) node.
• Generate SSH key pair on the control plane: ssh-keygen
• Copy the SSH public key to the worker node: ssh-copy-id user@worker-node

Pawar Divya
3. Create Ansible Inventory File

Add this:

4. Test SSH Connection via Ansible

Pawar Divya
5. Create Apache Installation Playbook:

Pawar Divya
6. Run the Playbook

Pawar Divya
7. Verify on Worker Node

In this task, we installed Apache on the control node, created a playbook, and used
it to install and configure Apache on the worker node with a custom message. This
demonstrates how Ansible makes it easy to automate tasks across multiple
servers.

Thank you!

Pawar Divya

You might also like