🚀 A practical, hands-on guide to mastering Ansible through structured levels of exercises, challenges, and real-world examples.
Ansible is a powerful, open-source automation tool used for configuration management, application deployment, and orchestration. If you’ve ever felt overwhelmed by tutorials that jump around or if you’re stuck in "tutorial purgatory," this repository is for you.
This project will guide you through a task-based approach to learning Ansible, one step at a time. Each "level" builds on the previous one, covering key concepts and providing actionable tasks to solidify your understanding.
- Basic knowledge of Linux commands
- Familiarity with SSH and text editors (like
vim
ornano
) - Basic knowledge of Docker (since we will be using Docker containers for setting up our environment)
-
Objective: Learn basic Ansible commands and test connections.
-
Topics Covered:
- Installing Ansible
- Understanding the control node and managed nodes
- SSH key-based authentication
- Ansible Inventory
-
Tasks:
- Set Up Your Ansible Environment
- Create your inventory file
- Run your first ansible ping command
-
Objective: Understand how to configure Ansible settings for ease of use.
-
Topics Covered:
- Ansible Configuration file
-
Tasks:
- Create a custom ansible.cfg file and run the ansible ping command
-
Objective: Learn to execute commands on managed nodes using ad-hoc Ansible commands and Ansible modules.
-
Topics Covered:
- Ad-hoc Commands
- Ansible Modules
-
Tasks:
- Check the system uptime on all managed nodes using ad-hoc commands.
- Use the provided modules to create and delete a file on managed nodes.
- Use an ad-hoc command to check the disk space usage on all managed nodes.
- Run a command to display the memory usage on all managed nodes.
-
Objective: Understand how to create and execute playbooks for automating tasks.
-
Topics Covered:
- Defining Playbook, Play, Task, and Modules
- Verifying Playbooks
-
Tasks:
- Basic File Management
- Service Installation and Management
- User and Group Management
- Managing Package Versions
- Follow Each Level in Order: Each level builds on the previous one.
- Test Your Knowledge: Try creating your own playbooks and modules after each level.
- Share Your Progress: Create a branch for your solutions or raise issues for discussions.
Contributions are welcome! Here’s how you can contribute:
- Fork the repository.
- Create a new branch (feature/my-improvement).
- Submit a pull request (PR) with a clear description.
Happy automating! 🎉