๐ ANSAI Interactive Tutorials¶
Learn by building. Step-by-step, executable tutorials.
Each tutorial is an interactive script that walks you through building a real ANSAI workflow. Copy-paste to run, or study the code to understand how it works.
๐ Available Tutorials¶
๐๏ธ Infrastructure Automation¶
-
Auto-Scale Based on Error Rates โ
Automatically scale resources when error rates spike -
ChatOps for Infrastructure โ
Control your infrastructure from Slack/Discord -
Multi-Cloud Orchestration โ
Deploy to AWS with automatic DigitalOcean fallback -
Cost Optimization Scheduling โ
Shutdown dev environments at night, save 50%
๐ Security & Compliance¶
-
Compliance Auto-Remediation โ
Automatically fix security misconfigurations -
Chaos Engineering Testing โ
Test self-healing with random service failures
๐ค Advanced AI Ops¶
-
Self-Optimizing Database โ
AI-powered PostgreSQL/MySQL configuration tuning -
Predictive Maintenance โ
Detect and fix issues before they happen
๐ How to Use¶
Option 1: Run Directly (Easiest)¶
# Download and run any tutorial
curl -sSL https://raw.githubusercontent.com/thebyrdman-git/ansai/main/docs/examples/tutorials/01-auto-scale-on-errors.sh | bash
Option 2: Download and Customize¶
# Download tutorial
curl -O https://raw.githubusercontent.com/thebyrdman-git/ansai/main/docs/examples/tutorials/01-auto-scale-on-errors.sh
# Make it executable
chmod +x 01-auto-scale-on-errors.sh
# Review the code
cat 01-auto-scale-on-errors.sh
# Run it
./01-auto-scale-on-errors.sh
Option 3: Clone All Tutorials¶
# Clone ANSAI repository
git clone https://github.com/thebyrdman-git/ansai.git
cd ansai/docs/examples/tutorials
# Run any tutorial
./01-auto-scale-on-errors.sh
๐ Tutorial Format¶
Each tutorial follows this structure:
- Introduction: What you'll build and why it's useful
- Prerequisites: What you need before starting
- Step-by-Step: Interactive guided implementation
- Testing: Verify it works
- Customization: How to adapt it to your needs
- Next Steps: Related tutorials and documentation
Tutorials are designed to be: - โ Interactive: Prompts and confirmations - โ Educational: Explanations at each step - โ Practical: Real, working code - โ Customizable: Easy to adapt to your environment
๐ฏ Learning Paths¶
Path 1: Getting Started with ANSAI¶
- Start: ChatOps for Infrastructure
- Then: Auto-Scale Based on Error Rates
- Finally: Compliance Auto-Remediation
Path 2: Advanced AI Operations¶
- Start: Self-Optimizing Database
- Then: Predictive Maintenance
- Finally: Multi-Cloud Orchestration
Path 3: Security & Reliability¶
- Start: Compliance Auto-Remediation
- Then: Chaos Engineering Testing
- Finally: Cost Optimization Scheduling
๐ก Tips for Success¶
Before Starting¶
# 1. Install ANSAI
curl -sSL https://raw.githubusercontent.com/thebyrdman-git/ansai/main/install.sh | bash
# 2. Set up AI provider
export ANSAI_GROQ_API_KEY="your-key-here" # Get free key at console.groq.com
# 3. Verify installation
ansai-self-test
During Tutorials¶
- Read the code: Don't just run it, understand it
- Customize: Replace example values with your real ones
- Experiment: Try variations and see what happens
- Ask questions: Use GitHub Discussions
After Completing¶
- Share your results: Post in Show & Tell
- Contribute improvements: Submit PRs
- Build on it: Combine tutorials for more complex workflows
๐ Troubleshooting¶
Tutorial won't run¶
# Check permissions
ls -l tutorial-name.sh
# Make executable
chmod +x tutorial-name.sh
# Check for dependencies
which ansible
which python3
AI not working¶
# Verify API key
echo $ANSAI_GROQ_API_KEY
# Test Groq API
curl https://api.groq.com/openai/v1/models \
-H "Authorization: Bearer $ANSAI_GROQ_API_KEY"
Ansible errors¶
# Check Ansible version
ansible --version
# Verify inventory
ansible-inventory --list
# Test connection
ansible all -m ping
๐ค Contributing Tutorials¶
Built a great workflow? Share it as a tutorial!
Tutorial Template¶
#!/bin/bash
# Tutorial: [Your Topic]
# Description: [What users will learn]
# Time: [Estimated completion time]
# Prerequisites: [What's needed]
set -e
# [Your tutorial code here]
Submission Guidelines¶
- Clear objectives: State what users will learn
- Interactive: Include prompts and explanations
- Tested: Run it on a fresh system
- Documented: Comments explaining each step
- Safe: No destructive operations without confirmation
๐ Tutorial Statistics¶
- Total Tutorials: 8
- Average Time: 15-30 minutes
- Difficulty Range: Beginner to Advanced
- Languages: Bash, Python, YAML
- Community Contributions: Coming soon!
๐ Most Popular¶
Based on community feedback:
- ๐ฅ ChatOps for Infrastructure - Control servers from Slack
- ๐ฅ Auto-Scale on Errors - Dynamic resource scaling
- ๐ฅ Self-Optimizing Database - AI-powered tuning
๐ Additional Resources¶
- Documentation: ansai.dev
- Examples: View all examples
- Community Roles: ANSAI + Ansible Galaxy
- Getting Started: Quick Start Guide
๐ฌ Get Help¶
- Questions: GitHub Discussions
- Issues: Report bugs
- Ideas: Suggest tutorials
Happy learning! Build intelligent automation. ๐