Skip to content

๐ŸŽ“ 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

  1. Auto-Scale Based on Error Rates โ†’
    Automatically scale resources when error rates spike

  2. ChatOps for Infrastructure โ†’
    Control your infrastructure from Slack/Discord

  3. Multi-Cloud Orchestration โ†’
    Deploy to AWS with automatic DigitalOcean fallback

  4. Cost Optimization Scheduling โ†’
    Shutdown dev environments at night, save 50%

๐Ÿ”’ Security & Compliance

  1. Compliance Auto-Remediation โ†’
    Automatically fix security misconfigurations

  2. Chaos Engineering Testing โ†’
    Test self-healing with random service failures

๐Ÿค– Advanced AI Ops

  1. Self-Optimizing Database โ†’
    AI-powered PostgreSQL/MySQL configuration tuning

  2. 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:

  1. Introduction: What you'll build and why it's useful
  2. Prerequisites: What you need before starting
  3. Step-by-Step: Interactive guided implementation
  4. Testing: Verify it works
  5. Customization: How to adapt it to your needs
  6. 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

  1. Start: ChatOps for Infrastructure
  2. Then: Auto-Scale Based on Error Rates
  3. Finally: Compliance Auto-Remediation

Path 2: Advanced AI Operations

  1. Start: Self-Optimizing Database
  2. Then: Predictive Maintenance
  3. Finally: Multi-Cloud Orchestration

Path 3: Security & Reliability

  1. Start: Compliance Auto-Remediation
  2. Then: Chaos Engineering Testing
  3. 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

  1. Clear objectives: State what users will learn
  2. Interactive: Include prompts and explanations
  3. Tested: Run it on a fresh system
  4. Documented: Comments explaining each step
  5. Safe: No destructive operations without confirmation

Submit Your Tutorial โ†’


๐Ÿ“Š Tutorial Statistics

  • Total Tutorials: 8
  • Average Time: 15-30 minutes
  • Difficulty Range: Beginner to Advanced
  • Languages: Bash, Python, YAML
  • Community Contributions: Coming soon!

Based on community feedback:

  1. ๐Ÿฅ‡ ChatOps for Infrastructure - Control servers from Slack
  2. ๐Ÿฅˆ Auto-Scale on Errors - Dynamic resource scaling
  3. ๐Ÿฅ‰ Self-Optimizing Database - AI-powered tuning

๐Ÿ“š Additional Resources


๐Ÿ’ฌ Get Help


Happy learning! Build intelligent automation. ๐Ÿš€