Ansible Learning
Ansible Learning
• Installing software
• Updating systems
• Managing many computers at once
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.
As for the master-worker setup (referring to a control node and managed nodes in
an Ansible setup):
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:
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