Ansible Course Complete Index & Guide
Course: Ansible for Beginners (ADV-IT)
YouTube Playlist: https://www.youtube.com/watch?v=Ck1SGolr6GI&list=PLg5SS_4L6LYufspdPupdynbMQTBnZd31N
Author: Denis Astahov (ADV-IT)
Language: Russian 🇷🇺
📚 Course Structure
Main Topics (5 files)
| # | File | Topics Covered | Level |
|---|---|---|---|
| 1 | 01-ansible-basics.md |
What is Ansible, push vs pull, comparison, business cases, requirements | Beginner |
| 2 | 02-ansible-installation.md |
Installation on Linux/macOS/Windows, SSH setup, inventory, first connection | Beginner |
| 3 | 03-adhoc-playbooks.md |
Ad-hoc commands, first playbooks, YAML syntax, basic modules | Beginner |
| 4 | 04-variables-templates-roles.md |
Variables, facts, templates (Jinja2), roles, Vault secrets | Intermediate |
| 5 | 05-ansible-commands-reference.md |
Command reference, best practices, troubleshooting, patterns | Reference |
Quick Index
| Reference | File | Description |
|---|---|---|
| Commands | 05-ansible-commands-reference.md |
All Ansible commands and examples |
| Course Guide | 06-ansible-course-index.md |
This file |
🎯 Course Overview by Lessons
Урок 1: Основы Ansible
Topics: Что такое Ansible, история, сравнение с Chef/Puppet/Salt, push vs pull, бизнес-кейсы Time: 1-2 часа Outcome: Понимаете why Ansible и когда его использовать
Урок 2-3: Установка и настройка
Topics: Установка на Linux/macOS/Windows, SSH ключи, inventory, ansible.cfg Time: 2-3 часа Outcome: Установленный Ansible с готовой инфраструктурой
Урок 4-5: Ad-Hoc команды и Playbooks
Topics: Однократные команды, первый playbook, YAML синтаксис, модули Time: 2-3 часа Outcome: Пишете первые playbooks и выполняете их
Урок 6-9: Переменные, шаблоны, роли
Topics: Переменные, факты, Jinja2 шаблоны, роли, Vault для секретов Time: 4-6 часов Outcome: Структурированный и переиспользуемый код
Урок 10+: Продвинутые техники
Topics: Условия, циклы, обработка ошибок, тестирование, CI/CD интеграция Time: 5-8 часов Outcome: Production-ready конфигурации
🚀 Learning Paths
Path 1: Quick Start (4-6 hours)
- 01-ansible-basics.md (1 hour)
- 02-ansible-installation.md (1-2 hours)
- 03-adhoc-playbooks.md (2-3 hours)
Result: Можете запускать простые playbooks на группе серверов
Path 2: Developer (10-15 hours)
- 01-ansible-basics.md
- 02-ansible-installation.md
- 03-adhoc-playbooks.md
- 04-variables-templates-roles.md (часть про переменные)
- Практика: написать первую роль
Result: Создаете переиспользуемые роли и управляете конфигурацией
Path 3: Production Engineer (20-30 hours)
Все файлы +: - Ansible Galaxy и готовые роли - Integration с Git/CI-CD - Использование Vault в production - Мониторинг и логирование - Масштабирование на 1000+ серверов
Result: Enterprise-level инфраструктура через Ansible
💡 Key Concepts
Ansible Architecture
Control Server (Linux)
├─ ansible-playbook
├─ inventory files
├─ roles
└─ vault
│
┌───────┴───────┐
│ │
SSH SSH SSH SSH
│ │
┌───────▼──────┐ ┌────▼───────┐
│ Server 1 │ │ Server 2 │
│ (Linux) │ │ (Linux) │
│ Python │ │ Python │
└──────────────┘ └────────────┘
YAML Syntax (Playbook)
---
- name: Play description # Блок задач
hosts: webservers # На каких хостах
become: yes # Использовать sudo
vars: # Переменные
var1: value1
tasks: # Основные задачи
- name: Task description
module_name:
param1: value1
register: var_name # Сохранить результат
handlers: # Обработчики (notify)
- name: Restart service
service:
name: nginx
Popular Modules
| Module | Purpose | Example |
|---|---|---|
| ping | Test connectivity | m: ping |
| shell | Run shell command | shell: ps aux |
| apt/yum | Install packages | apt: name=nginx |
| copy | Copy files | copy: src=/local dest=/remote |
| template | Jinja2 templates | template: src=nginx.j2 dest=/etc/nginx |
| service | Manage services | service: name=nginx state=started |
| user | Manage users | user: name=john groups=sudo |
| file | File operations | file: path=/tmp/test state=absent |
| lineinfile | Edit file lines | lineinfile: path=/etc/hosts line="127.0.0.1 localhost" |
| debug | Print output | debug: var=variable_name |
✅ Learning Checklist
Basics
- [ ] Понимаете что такое Ansible и зачем он нужен
- [ ] Знаете разницу между Push и Pull моделями
- [ ] Установили Ansible на свою машину
- [ ] Настроили SSH ключи для подключения
Inventory & Connection
- [ ] Создали inventory файл с группами серверов
- [ ] Проверили подключение через ping
- [ ] Получили факты о системе через setup
- [ ] Поняли как работают переменные хоста/группы
Ad-Hoc & Playbooks
- [ ] Запускали ad-hoc команды для быстрых операций
- [ ] Написали первый простой playbook
- [ ] Использовали основные модули (apt, copy, service)
- [ ] Запустили playbook успешно
Variables & Templates
- [ ] Использовали переменные в playbooks
- [ ] Работали с group_vars и host_vars файлами
- [ ] Создали Jinja2 шаблон
- [ ] Использовали факты системы
Roles & Organization
- [ ] Создали простую роль (webserver, database)
- [ ] Использовали роли в playbooks
- [ ] Организовали проект по best practices
- [ ] Создали handlers для notification
Vault & Security
- [ ] Защитили секреты через Ansible Vault
- [ ] Запустили playbook с vault-encrypted файлами
- [ ] Поняли как хранить пароли безопасно
- [ ] Установили vault password file
Advanced
- [ ] Использовали условия (when)
- [ ] Использовали циклы (loop)
- [ ] Обработали ошибки (ignore_errors, until)
- [ ] Интегрировали с Git/CI-CD
📖 Recommended Study Order
DAY 1: Basics (3-4 часа)
├─ 01-ansible-basics.md (theory)
├─ 02-ansible-installation.md (practice)
└─ First ad-hoc commands
DAY 2: Playbooks (3-4 часа)
├─ 03-adhoc-playbooks.md (theory & practice)
└─ Write 3-5 simple playbooks
DAY 3: Variables & Templates (3-4 часа)
├─ 04-variables-templates-roles.md (variables section)
├─ Create group_vars/host_vars
└─ Write Jinja2 template
DAY 4: Roles (3-4 часа)
├─ 04-variables-templates-roles.md (roles section)
├─ Create first role
└─ Refactor playbooks to use roles
DAY 5: Vault & Advanced (3-4 часа)
├─ 04-variables-templates-roles.md (vault section)
├─ Protect secrets
└─ Practice advanced patterns
DAY 6: Review & Practice (4-6 часов)
├─ 05-ansible-commands-reference.md (reference)
├─ Build production-like project
└─ Deploy real application
🔧 Real-World Use Cases
Use Case 1: Deploy Web Application
Time: 2-3 hours
Files needed: 01-04
Steps:
1. Write role for nginx installation
2. Create template for config
3. Deploy app files
4. Start service
5. Verify health
Use Case 2: System Administration
Time: 3-5 hours
Files needed: 01-05
Steps:
1. Create inventory with all servers
2. Write playbook for system updates
3. Create users and groups
4. Configure SSH access
5. Set monitoring
Use Case 3: Multi-Environment Setup
Time: 4-6 hours
Files needed: 01-05 + advanced
Steps:
1. Create inventories for dev/staging/prod
2. Use group_vars for env-specific configs
3. Create reusable roles
4. Use Vault for secrets per environment
5. Deploy to all environments
Use Case 4: Infrastructure as Code (IaC)
Time: 8-12 hours
Files needed: All files
Steps:
1. Version control all playbooks
2. Create modular roles
3. Integrate with Git/CI-CD
4. Deploy on every commit
5. Maintain drift detection
🎓 Recommended Projects
Beginner
- Deploy single web server - Install nginx, configure, start
- Manage multiple servers - Apply same config to 3-5 servers
- System hardening - Create playbook to secure servers
Intermediate
- Multi-tier application - Web + DB + Cache layers
- Configuration management - Manage 20+ servers
- Load balancer setup - Configure nginx as reverse proxy
Advanced
- Full stack deployment - Complete application with monitoring
- CI/CD integration - Deploy from Git commits
- Disaster recovery - Backup/restore procedures
- Multi-cloud setup - AWS + GCP + On-prem
📚 Additional Resources
Official Documentation
- Main Docs: https://docs.ansible.com/
- Modules Index: https://docs.ansible.com/ansible/latest/modules/
- Playbook Best Practices: https://docs.ansible.com/ansible/latest/tips_tricks/
- Galaxy (Roles): https://galaxy.ansible.com/
Learning Platforms
- Ansible Learning Path: https://learn.redhat.com/
- YouTube Tutorials: Many free channels
- Online Courses: Udemy, Coursera, Linux Academy
Community
- Reddit: https://reddit.com/r/ansible/
- Stack Overflow: ansible tag
- Slack: #ansible in various communities
- GitHub: ansible/ansible
🔒 Security Best Practices
✅ DO
- ✅ Use SSH keys instead of passwords
- ✅ Protect secrets with Ansible Vault
- ✅ Use become for privilege escalation
- ✅ Version control playbooks (not state)
- ✅ Restrict SSH access with security groups
- ✅ Audit changes and keep logs
- ✅ Use separate inventories per environment
❌ DON'T
- ❌ Store passwords in plain text
- ❌ Use root for everything
- ❌ Run playbooks without review
- ❌ Commit .vault_pass to Git
- ❌ Use same credentials everywhere
- ❌ Skip security group configuration
- ❌ Ignore error handling
📋 Common Commands Quick Reference
# Installation & Setup
ansible --version
ansible-galaxy init my_role
ansible-vault create secrets.yml
# Ad-Hoc Commands
ansible all -m ping
ansible webservers -m shell -a 'whoami'
ansible all -m setup -a 'filter=ansible_os_family'
# Playbooks
ansible-playbook site.yml
ansible-playbook site.yml --check
ansible-playbook site.yml -l webservers
ansible-playbook site.yml --tags install
# Vault
ansible-playbook site.yml --ask-vault-pass
ansible-playbook site.yml --vault-password-file=.vault_pass
# Debugging
ansible-playbook site.yml -v
ansible-playbook site.yml --check --diff
ansible-playbook site.yml --syntax-check
📊 Progress Tracking
- [ ] Finished 01-ansible-basics.md
- [ ] Finished 02-ansible-installation.md
- [ ] Finished 03-adhoc-playbooks.md
- [ ] Finished 04-variables-templates-roles.md
- [ ] Reviewed 05-ansible-commands-reference.md
- [ ] Created first working playbook
- [ ] Created first working role
- [ ] Protected secrets with Vault
- [ ] Deployed to production-like environment
- [ ] Integrated with version control (Git)
📝 Document Information
- Created: November 26, 2025
- Version: 1.0
- Total Files: 6 (5 lesson + 1 index)
- Estimated Study Time: 15-25 hours
- Last Updated: November 26, 2025
🎯 Goals After Course
You Will Be Able To:
- ✅ Automate server configuration with Ansible
- ✅ Manage multiple servers simultaneously
- ✅ Create reusable roles for infrastructure
- ✅ Deploy applications reliably
- ✅ Handle secrets and sensitive data
- ✅ Integrate with CI/CD pipelines
- ✅ Troubleshoot and debug playbooks
- ✅ Follow DevOps best practices
Career Impact:
- 📈 DevOps/SRE skills
- 📈 Infrastructure automation expertise
- 📈 Configuration management mastery
- 📈 Better job opportunities
Ready to automate your infrastructure? Let's get started! 🚀
Start with 01-ansible-basics.md and follow the learning path that matches your goals.