Welcome to the Ansible Practical Examples repository! This collection is designed to provide a range of Ansible playbooks and tasks, from basic to advanced, to help you learn and effectively use Ansible for configuration management and automation.
This repository contains a variety of Ansible playbooks demonstrating different tasks and configurations. Whether you're new to Ansible or looking to expand your knowledge with practical, everyday examples, you'll find valuable resources here.
Before you begin, ensure you have the following installed:
- Ansible (version 2.15 or later)
- Python (version 3.9 or later)
- SSH access to your target hosts
- Basic concepts
To install Ansible, follow these steps:
-
Using pip:
pip install ansible
-
Using package manager (Ubuntu example):
sudo apt update sudo apt install ansible
-
Using package manager (Fedora example):
sudo dnf install ansible
-
Using package manager (Mac example):
sudo brew install ansible
For detailed installation instructions, refer to the official Ansible installation guide.
These examples cover the fundamental concepts of Ansible, including:
- Setting up your first playbook
- Use Variables and Passing extra vars via command line
- Managing users and groups
- Installing Apps/Softwares
- Copying files
- Basic Jinga2 Templates
These examples demonstrate practical Ansible tasks you might encounter in daily operations:
- Configuring web servers
- Setting up databases
- Automating Kubernetes/Openshift set up
- Decrypt base64 content
- Practical Jinga2 Templates
- Security updates and patches
- LDAP
- CyberArk
- Network
- Zos IBM Mainframe
Explore the examples directory for simple examples and the day-to-day-work-examples for detailed playbooks and documentation.