diff --git a/2026/day-01/mk-learning-plan.md b/2026/day-01/mk-learning-plan.md new file mode 100644 index 0000000000..9c84da44c6 --- /dev/null +++ b/2026/day-01/mk-learning-plan.md @@ -0,0 +1,106 @@ +## Day 01 – Introduction to DevOps and Cloud +### Task +The goal of Day 01 is to set a strong foundation for my DevOps journey by creating a clear and realistic 90-day execution plan. +This plan defines my understanding, motivation, goals, and consistency strategy for becoming a DevOps Engineer. +
+Current Level + +
+My Understanding of DevOps & Cloud +DevOps is a cultural and set of practices that focuses on collaboration between development and operations teams to deliverable a scalable, reliable and optimum sofware as product. +Mainly DevOps plays major role in sofware industry as follows: + +Goal: The main goal of DevOps engineer is to deliver applications faster, more reliably, with automation and collaboration. +Keys areas focuses on: + +
+Why I Am Learning DevOps & Cloud + +
+Where I Want to Reach in 90 Days +By the end of 90 days, I want to: + +Core DevOps Skills I Want to Build +1. Linux & networking trobleshooting +2. Containerization, CI/CD Pipelining, Monitoriing +3. Orchestarization, Kubernetes deployment and debugging + +⏱ Weekly Time Commitment +Weekdays- 2-3hrs per day +Weekends- 6-8 hrs per day + +Focus will be on: + +Daily task completion +Hands-on practice +Consistent GitHub commits +at least 3-posts per week +
+##90DaysOfDevOps #TrainwithShubham +HappyLearning +Manish Kumar Vishwakarma diff --git a/2026/day-02/Linux-system-command-prac.pdf b/2026/day-02/Linux-system-command-prac.pdf new file mode 100644 index 0000000000..d84cf2694f Binary files /dev/null and b/2026/day-02/Linux-system-command-prac.pdf differ diff --git a/2026/day-02/linux-architecture-notes.md b/2026/day-02/linux-architecture-notes.md new file mode 100644 index 0000000000..4a52afb342 --- /dev/null +++ b/2026/day-02/linux-architecture-notes.md @@ -0,0 +1,58 @@ +## Linux Internals – DevOps Foundation +This document covers the core Linux concepts required for troubleshooting and system management in production environments. +1. Core Components of Linux + Kernel +The Linux kernel is the main component of a Linux operating system (OS) and is the core interface between a computer’s hardware and its processes. It communicates between the 2, managing resources as efficiently as possible. +The kernel is so named because—like a seed inside a hard shell—it exists within the OS and controls all the major functions of the hardware, whether it’s a phone, laptop, server, or any other kind of computer. +What the kernel does +The kernel has 4 jobs: +1. Memory management: Keep track of how much memory is used to store what, and where +2. Process management: Determine which processes can use the central processing unit (CPU), when, and for how long +3. Device drivers: Act as mediator/interpreter between the hardware and processes +4. System calls and security: Receive requests for service from the processes + +| **State** | **Full Form** | **Meaning** | **Real Scenario Example** | +| --------- | ------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------ | +| **R** | Running | Process is actively executing on CPU or ready to run | `nginx` handling a web request | +| **S** | Sleeping (Interruptible Sleep) | Waiting for a resource (disk, network, input) | App waiting for DB response | +| **T** | Stopped | Process is paused/stopped manually (e.g., via signal) | Pressed `Ctrl+Z` in terminal | +| **Z** | Zombie | Process finished execution but parent hasn’t collected exit status | Child process ended, parent didn’t call `wait()` | + +Why Process States Matter +| **Issue** | **Related Process State(s)** | **What It Indicates** | **What You Check as DevOps Engineer** | | +| ---------------------------- | ------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------- | ------------------------- | +| **High CPU Usage** | `R` (Running) | Process is actively consuming CPU | `top`, `htop`, `ps -eo %cpu --sort=-%cpu` | | +| **Memory Leaks** | Usually `S` or `R` | Process memory keeps increasing without release | `top`, `ps aux --sort=-%mem`, `free -m`, check OOM logs | | +| **Stuck / Unresponsive App** | `S` (Sleeping), `D` (Uninterruptible Sleep) | Waiting for I/O, disk, network, or DB | `ps -ef`, `strace -p `, check disk/network latency | | +| **Zombie Process** | `Z` (Zombie) | Process finished but parent hasn’t cleaned it | `ps -el | grep Z`, check parent PID | +| **Orphan Process** | Any state (adopted by PID 1) | Parent died before child | `ps -ef`, verify PPID = 1 | | + + +3. systemd – Service Management + + | **Component** | **Description** | + | ---------------------------- | ------------------------------------------------------------------------------------------- | + | **systemd** | Modern init system used in most Linux distributions to manage system processes and services | + | **Starts services at boot** | Automatically initializes and starts required services during system startup | + | **Restarts failed services** | Can automatically restart services if they crash (based on configuration) | + | **Manages dependencies** | Ensures services start in the correct order based on dependency relationships | + +4. Essential Daily Commands + | **Command** | **Purpose** | **Common Usage Example** | + | ------------ | ------------------------------------ | ------------------------ | + | `ps` | View running processes | `ps -ef` | + | `top` | Monitor real-time CPU & memory usage | `top` | + | `systemctl` | Manage system services | `systemctl status nginx` | + | `journalctl` | View system and service logs | `journalctl -u nginx` | + | `kill` | Terminate processes | `kill -9 ` | + +📌 Conclusion +Linux is the base operating system for most production systems. +Understanding kernel behavior, process lifecycle, and systemd service management forms the foundation for effective DevOps troubleshooting and incident response. + +Note: use ps and top for process monitoring, systemctl for service management, journalctl for log analysis, and kill for process control. + +#90DaysOfDevOps #TrainWithShubham + +Happy Learning +Manish Kumar Vishwakarma diff --git a/2026/day-03/linux advanced.pdf b/2026/day-03/linux advanced.pdf new file mode 100644 index 0000000000..2da0a21398 Binary files /dev/null and b/2026/day-03/linux advanced.pdf differ diff --git a/2026/day-03/linux-commands-cheatsheet.md b/2026/day-03/linux-commands-cheatsheet.md new file mode 100644 index 0000000000..2c9074fac5 --- /dev/null +++ b/2026/day-03/linux-commands-cheatsheet.md @@ -0,0 +1,83 @@ +# 🐧 Linux Command Toolkit – Long-Term Cheat Sheet + +This is a practical command reference focused on: +- Process Management +- File System Operations +- Networking Troubleshooting + +These are foundational commands used in DevOps, Cloud, and Linux administration. + +--- + +# 🔹 Process Management + +| Command | Usage | +|----------|--------| +| `ps aux` | List all running processes with CPU and memory usage. | +| `ps -ef` | Show processes in full-format listing. | +| `top` | Real-time process and resource monitor. | +| `htop` | Interactive process viewer (enhanced top). | +| `pgrep ` | Find process ID by name. | +| `pidof ` | Get PID of a specific process. | +| `kill ` | Send termination signal to a process. | +| `kill -9 ` | Force kill a process immediately. | +| `pkill ` | Kill processes by name. | +| `nice -n 10 ` | Start a process with adjusted priority. | +| `renice -n 5 -p ` | Change priority of running process. | +| `jobs` | Show background jobs in current shell. | +| `bg` | Resume a job in background. | +| `fg` | Bring a background job to foreground. | +| `uptime` | Show system uptime and load average. | + +--- + +# 🔹 File System Management + +| Command | Usage | +|----------|--------| +| `pwd` | Show current working directory. | +| `ls -lah` | List files with permissions and sizes. | +| `cd ` | Change directory. | +| `mkdir ` | Create a directory. | +| `mkdir -p path/dir` | Create nested directories. | +| `touch file.txt` | Create an empty file. | +| `cp src dest` | Copy files or directories. | +| `mv src dest` | Move or rename files/directories. | +| `rm file` | Delete a file. | +| `rm -rf dir` | Remove directory recursively (use carefully). | +| `find /path -name "file"` | Search files by name. | +| `du -sh ` | Show disk usage of files/directories. | +| `df -h` | Show disk space usage. | +| `stat file` | Display detailed file metadata. | +| `chmod 755 file` | Change file permissions. | +| `chown user:group file` | Change file ownership. | +| `less file.log` | View large file with scrolling. | +| `tail -f file.log` | Monitor file in real time. | + +--- + +# 🔹 Networking Troubleshooting + +| Command | Usage | +|----------|--------| +| `ip addr` | Display IP addresses of network interfaces. | +| `ping google.com` | Test connectivity and latency to host. | +| `curl -I https://example.com` | Check HTTP response headers. | +| `dig example.com` | Query DNS records. | +| `ss -tulnp` | Show listening ports and services. | +| `netstat -tulnp` | Display open ports and connections. | + + +--- + +# 🔹 Log & Service Debugging Essentials + +| Command | Usage | +|----------|--------| +| `journalctl -u nginx` | View logs for specific systemd service. | +| `journalctl -f` | Follow system logs in real time. | +| `systemctl status nginx` | Check service status and recent logs. | + +--- + + diff --git a/2026/day-04/linux-practice.md b/2026/day-04/linux-practice.md new file mode 100644 index 0000000000..bae6808af0 --- /dev/null +++ b/2026/day-04/linux-practice.md @@ -0,0 +1,76 @@ +### Linux Practice: Processes and Services +1️⃣ Check Running Processes + + +image
+ +image
+top command: +image + +📊 System Health Checks (Quick Snapshot) +| Check Item | Command Used | What It Shows | What to Look For | +| -------------------- | -------------- | -------------------------- | ------------------------------------ | +| CPU Usage | `top` / `htop` | Real-time CPU consumption | High `%us` or `%sy` values | +| Memory Usage | `free -m` | RAM & swap usage | Low free memory, high swap usage | +| Load Average | `uptime` | System load (1, 5, 15 min) | Load > CPU cores = possible overload | +| Running Processes | `ps aux` | All running processes | High `%CPU` or `%MEM` values | +| Live Process Monitor | `top` | Dynamic process view | Identify abnormal resource usage | + +usage +🔎 Identifying High CPU Process (Inside top) +| Action | Key Press | Purpose | +| -------------- | ----------- | ----------------------------------------- | +| Sort by CPU | `Shift + P` | Shows highest CPU-consuming process first | +| Sort by Memory | `Shift + M` | Shows highest memory-consuming process | +| Kill a Process | `k` | Terminate selected process | +| Refresh Faster | `d` | Change refresh interval | + +2️⃣ Inspect One systemd Service + +Check Status of SSH Service +image +
+) +🔹 View Logs for That Service + +image +✅ Step 1: Check CPU & Load +top +uptime + +image +Step 2: Check Memory +free -h +image +Step 3: Check Disk +df -h +image +If disk > 90% full → possible issue. + +Service Practice Note – SSH Service (sshd) +1️⃣ Check if Service is Running +systemctl status ssh + +image +
+2️⃣ Check if SSH is Enabled at Boot +image +Step 2️⃣ Enable SSH to start at boot +image +
+Step 3️⃣ If SSH is not running, start it +sudo systemctl start ssh +Then verify: +systemctl status ssh +so use +systemctl enable sshd +systemctl start sshd +systemctl status sshd +image +
+Use hashtags: #90DaysOfDevOps #TrainWithShubham + +Happy Learning +Manish Kumar Vishwakarma + diff --git a/2026/day-05/linux-troubleshooting-runbook.md b/2026/day-05/linux-troubleshooting-runbook.md new file mode 100644 index 0000000000..2a69ded84d --- /dev/null +++ b/2026/day-05/linux-troubleshooting-runbook.md @@ -0,0 +1,57 @@ +## Day 05 – Linux Troubleshooting Drill: CPU, Memory, and Logs +Focused Troubleshooting Runbook + +1️⃣ Environment Basics +uname -a +image +Command 2: OS Version + +cat /etc/os-release +image +2️⃣ Filesystem Sanity +Command 3: Create Test Directory + +image +cp /etc/hosts /tmp/runbook-demo/hosts-copy +ls -l /tmp/runbook-demo + +image +3️⃣ CPU / Memory (2) +Command 5: Check Process Resource Usage +ps -eo pid,pcpu,pmem,comm --sort=-pcpu | head +image +Command 6: Memory Snapshot +free -h + +image +4️⃣ Disk / IO (2) +Command 7: Disk Usage +df -h + +image +Command 8: Log Directory Size +du -sh /var/log + +image +5️⃣ Network (2) +Command 9: Check Listening Ports +ss -tulpn | grep nginx + +image +Command 10: Test Service Endpoint + +image + +6️⃣ Logs (2) +Command 11: Service Logs +connect() failed (111: Connection refused) while connecting to upstream +Command 12: Application Log +OSError: [Errno 98] Address already in use +
+Use hashtags: +#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham + +Happy Learning +Manish Kumar Vishwakarma + + diff --git a/2026/day-06/file-io-practice.md b/2026/day-06/file-io-practice.md new file mode 100644 index 0000000000..c12936838c --- /dev/null +++ b/2026/day-06/file-io-practice.md @@ -0,0 +1,61 @@ +### Day 06 – Linux Fundamentals: Read and Write Text Files +Today’s goal is to practice basic file read/write using only fundamental commands. + +You will create a small text file and practice: + +Creating a file +Writing text to a file +Appending new lines +Reading the file back +Keep it basic and repeatable. +
+Step 1: Create a File +touch mynotes.txt + +



+image +



+Step 2: Write Text to the File (Overwrite Mode) +



+echo "This is my testing file." > mynotes.txt +echo "This is my testing file content." >> mynotes.txt +echo "This is another content for testing line 3" | tee -a mynotes.txt +



+image +



+image +Command 3: +head -n 2 mynotes.txt +



+image +tail -n 2 mynotes.txt +

+image +



+
+1. Logs = Text Files +COMMAND USED TO VERIFY LOGS +/var/log/syslog + +/var/log/auth.log + +/var/log/nginx/access.log +2. Configuration Files = Text Files +/etc/ssh/sshd_config + +/etc/nginx/nginx.conf + +/etc/fstab + +

+
+Use hashtags: +#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham + +Happy Learning +Manish Kumar Vishwakarma + + + + + diff --git a/2026/day-07/linux-fs-and-scenarios.md b/2026/day-07/linux-fs-and-scenarios.md new file mode 100644 index 0000000000..625fa86ef4 --- /dev/null +++ b/2026/day-07/linux-fs-and-scenarios.md @@ -0,0 +1,39 @@ +### Day 07 – Linux File System Hierarchy & Scenario-Based Practice + +Task +Today's goal is to understand where things live in Linux and practice troubleshooting like a DevOps engineer. + +You will create notes covering: + +Linux File System Hierarchy (the most important directories) +Practice solving real-world scenarios step by step + +
+Root Directory) + +The starting point of everything in Linux. + +All files and directories branch from /. + +Similar to C:\ in Windows (but Linux has one unified tree). + +CORE COMMANDS: +1. ls / +

+ +image +2. /home +

+ +image +3. cd /root +

+image +4. cd /etc +

+image +

+cd /var/log +image +

+ diff --git a/2026/day-08/cloud-deployment.md b/2026/day-08/cloud-deployment.md new file mode 100644 index 0000000000..8a7adf41d4 --- /dev/null +++ b/2026/day-08/cloud-deployment.md @@ -0,0 +1,41 @@ +## Day 08 – Cloud Server Setup: Docker, Nginx & Web Deployment +Task +Today's goal is to deploy a real web server on the cloud and learn practical server management. + +Launch a cloud instance (AWS EC2 or Utho) +Connect via SSH +Install Nginx +Configure security groups for web access (port 80 by default for nginx) +Extract and save logs to a file +Verify your webpage is accessible from the internet +This is real DevOps work - exactly what you'll do in production. +
+ +1. Objective + Deploy an Nginx web server on a cloud virtual machine and verify: +
    +
  • + SSH connectivity +
  • +
  • + Nginx installation +
  • +
  • + Web server accessibility +
  • +
  • + Log file verification +
  • +
+2. Step 1 – SSH into Server + Command Used: +ssh ubuntu@ec2-34-215-147-145.us-west-2.compute.amazonaws.com + image +

+3. Step 2 – Install Nginx +COMMAND: +sudo apt update +sudo apt install nginx -y + image +Check status +
diff --git a/2026/day-13/day-13-lvm.md b/2026/day-13/day-13-lvm.md new file mode 100644 index 0000000000..afef3e5f79 --- /dev/null +++ b/2026/day-13/day-13-lvm.md @@ -0,0 +1,99 @@ +## Day 13 – Linux Volume Management (LVM) +Task +Learn LVM to manage storage flexibly – create, extend, and mount volumes. + +Watch First: Linux LVM Tutorial + +Expected Output +A markdown file: day-13-lvm.md +Screenshots of command outputs + +
+ +### Commands Used +### Task 1: Check Current Storage +| Task | Command | Purpose | Expected Result | +| ----------------------------- | ------- | --------------------------------------------- | --------------------------------------------------- | +| **Check Block Devices** | `lsblk` | Lists all disks, partitions, and mount points | Shows devices like `/dev/nvme1n1`, `/dev/sda`, etc. | +| **Check Physical Volumes** | `pvs` | Displays existing LVM physical volumes | Shows PV name, VG name, size | +| **Check Volume Groups** | `vgs` | Displays existing volume groups | Shows VG name, size, free space | +| **Check Logical Volumes** | `lvs` | Displays logical volumes inside VGs | Shows LV name, VG name, size | +| **Check Mounted Filesystems** | `df -h` | Shows mounted storage usage | Displays filesystem size, used space | + + + +### Task 2: Create Physical Volume +| Command | Purpose | Output | +| ----------------------- | --------------------------------------- | ---------------------------- | +| `pvcreate /dev/nvme1n1` | Initializes disk as LVM Physical Volume | PV created successfully | +| `pvs` | Verify PV creation | Shows `/dev/nvme1n1` in list | + +### Task 3: Create Volume Group +| Command | Purpose | Output | +| --------------------------------- | ----------------------------- | --------------------------- | +| `vgcreate devops-vg /dev/nvme1n1` | Creates Volume Group using PV | VG created | +| `vgs` | Verify VG | Shows `devops-vg` with size | + + +### Task 4: Create Logical Volume +| Command | Purpose | Output | +| ---------------------------------------- | ---------------------------- | ------------------- | +| `lvcreate -L 500M -n app-data devops-vg` | Creates 500MB Logical Volume | LV created | +| `lvs` | Verify LV | Shows `app-data` LV | + +### Task 5: Format and Mount Logical Volume +| Command | Purpose | Output | +| --------------------------------------------- | ------------------------------- | -------------------- | +| `mkfs.ext4 /dev/devops-vg/app-data` | Formats LV with ext4 filesystem | Filesystem created | +| `mkdir -p /mnt/app-data` | Creates mount directory | Directory created | +| `mount /dev/devops-vg/app-data /mnt/app-data` | Mounts logical volume | Storage mounted | +| `df -h /mnt/app-data` | Verify mount and size | Shows ~500MB mounted | + + +### Command Used for Check Usuage +#### 1. lsblk (List of ESB block storage) +| NAME | MAJ:MIN | RM | SIZE | RO | TYPE | MOUNTPOINT | +| ---------------------- | ------- | -- | ---- | -- | ---- | ------------- | +| nvme0n1 | 259:0 | 0 | 20G | 0 | disk | | +| ├─nvme0n1p1 | 259:1 | 0 | 1G | 0 | part | /boot | +| └─nvme0n1p2 | 259:2 | 0 | 19G | 0 | part | / | +| nvme1n1 | 259:3 | 0 | 10G | 0 | disk | | +| └─devops--vg-app--data | 253:0 | 0 | 500M | 0 | lvm | /mnt/app-data | + +image +
+ +image + + +#### 2. pvc (Physical Volumes) +| PV | VG | Fmt | Attr | PSize | PFree | +| ------------ | --------- | ---- | ---- | ------ | ----- | +| /dev/nvme1n1 | devops-vg | lvm2 | a-- | 10.00g | 9.50g | + +#### 3. vgs (Volume Groups) +| VG | #PV | #LV | #SN | Attr | VSize | VFree | +| --------- | --- | --- | --- | ------ | ------ | ----- | +| devops-vg | 1 | 1 | 0 | wz--n- | 10.00g | 9.50g | +#### 4. lvs (Logical Volumes) +| LV | VG | Attr | LSize | Pool | Origin | Data% | Meta% | +| -------- | --------- | ---------- | ------- | ---- | ------ | ----- | ----- | +| app-data | devops-vg | -wi-a----- | 500.00m | | | | | + +#### 5. df -h (Disk Usage) +| Filesystem | Size | Used | Avail | Use% | Mounted on | +| -------------------------------- | ---- | ---- | ----- | ---- | ------------- | +| /dev/nvme0n1p2 | 19G | 3.2G | 15G | 18% | / | +| /dev/nvme0n1p1 | 1G | 150M | 850M | 15% | /boot | +| /dev/mapper/devops--vg-app--data | 496M | 24K | 462M | 1% | /mnt/app-data | +#### 6. Format and Mount Logical Volume +| Filesystem | Size | Used | Avail | Use% | Mounted on | +| -------------------------------- | ---- | ---- | ----- | ---- | ------------- | +| /dev/mapper/devops--vg-app--data | 496M | 24K | 462M | 1% | /mnt/app-data | + +#### 7. Extend Logical Volume +| Filesystem | Size | Used | Avail | Use% | Mounted on | +| -------------------------------- | ---- | ---- | ----- | ---- | ------------- | +| /dev/mapper/devops--vg-app--data | 696M | 30K | 640M | 1% | /mnt/app-data | + + diff --git a/2026/day-16/day-16-shell-scripting.md b/2026/day-16/day-16-shell-scripting.md new file mode 100644 index 0000000000..48894d2c15 --- /dev/null +++ b/2026/day-16/day-16-shell-scripting.md @@ -0,0 +1,126 @@ +# Shell Scripting Basics +
+ +### Task 1: First Script +1. Create a file hello.sh +2. Add the shebang line #!/bin/bash at the top +3. Print Hello, DevOps! using echo +4. Make it executable and run it +
+Scripts +What happens if you remove the shebang line? +./hello.sh + +The kernel checks for a shebang to determine which interpreter should run the script. + +If no shebang is found, the system executes the script using the current shell (usually the shell you are logged into). + +bash hello.sh + +The script is explicitly executed by the Bash shell. + +It does not depend on the shebang line. + +sh hello.sh + +The script is executed using the sh shell. + +Behavior may differ from Bash because sh may not support all Bash-specific features. + +image +
+Task 2: Variables +1. Create variables.sh with: +
    +
  • A variable for your NAME
  • +
  • A variable for your ROLE (e.g., "DevOps Engineer")
  • +
  • Print: Hello, I am and I am a
  • + +2. Try using single quotes vs double quotes — what's the difference? +
      +
    • Using double quote " " - Allow variable expansion +
    • +
    • Using single quote ' ' - Treat every character exactly as written +
    • +
    +
    + +image +
    +Task 3: User Input with read +
      + +Create greet.sh that: +
    • Asks the user for their name using read
    • +
    • Asks for their favourite tool
    • +
    • Prints: Hello , your favourite tool is +
    • +
    + +### Scripts: + +image +
    +### Task 4: If-Else Conditions +1. Create check_number.sh that: +
      +
    • Takes a number using read +
    • +
    • Prints whether it is positive, negative, or zero +
    • + +
    +

    +### Script: + +image +
    + +2. Create file_check.sh that: +
      + +Asks for a filename + +
    • Checks if the file exists using -f
    • +
    • Prints appropriate message
    • +
    +### Script: +image +
    +Task 5: Combine It All +Create server_check.sh that: +
      +
    • Stores a service name in a variable (e.g., nginx, sshd) +
    • +
    • Asks the user: "Do you want to check the status? (y/n)" +
    • +
    • If y — runs systemctl status and prints whether it's active or not +
    • +
    • If n — prints "Skipped." +
    • +
    +
    + image +

    + OUTPUT: + + image + +
    + +| **Topic** | **What I Learned** | **Example / Command** | +| ------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------- | +| **Shebang & Script Execution** | Learned how to write and execute Bash scripts using the shebang `#!/bin/bash` to specify the interpreter. | `#!/bin/bash` and run with `./script.sh` | +| **Variables in Bash** | Learned how to assign variables and access them using `$`. | `name="Manish"` → `echo $name` | +| **Single vs Double Quotes** | Double quotes allow variable expansion, while single quotes treat text literally. | `"Hello $name"` vs `'Hello $name'` | +| **User Input** | Learned how to take input from users using the `read` command. | `read username` | +| **Conditional Statements** | Used `if`, `elif`, and `else` to control script flow based on conditions. | `if [ $num -gt 0 ]; then` | +| **Numeric Comparisons** | Learned to check numbers using operators like `-gt`, `-lt`, and `-eq`. | `[ $num -gt 0 ]` | +| **File Existence Check** | | | + + + + + + diff --git a/2026/day-17/ scripts/countdown.sh b/2026/day-17/ scripts/countdown.sh new file mode 100644 index 0000000000..5e417a031c --- /dev/null +++ b/2026/day-17/ scripts/countdown.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Ask the user for a number +echo "Enter a number to start countdown:" +read num + +# Countdown using while loop +while [ $num -ge 0 ] +do + echo $num + num=$((num-1)) +done + +# Final message +echo "Done!" diff --git a/2026/day-17/ scripts/for_loop.sh b/2026/day-17/ scripts/for_loop.sh new file mode 100644 index 0000000000..be83a97262 --- /dev/null +++ b/2026/day-17/ scripts/for_loop.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# List of fruits +fruits=("Apple" "Banana" "Mango" "Orange" "Grapes") + +# Loop through the list +for fruit in "${fruits[@]}" +do + echo "$fruit" +done diff --git a/2026/day-17/ scripts/greet.sh b/2026/day-17/ scripts/greet.sh new file mode 100644 index 0000000000..1b56832dbf --- /dev/null +++ b/2026/day-17/ scripts/greet.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Check if argument is provided +if [ -z "$1" ]; then + echo "Usage: ./greet.sh " +else + echo "Hello, $1!" +fi diff --git a/2026/day-17/day-17-scripting.md b/2026/day-17/day-17-scripting.md new file mode 100644 index 0000000000..45e0ce59ab --- /dev/null +++ b/2026/day-17/day-17-scripting.md @@ -0,0 +1,137 @@ +# Day 17 – Shell Scripting: Loops, Arguments & Error Handling +## Task 1: For Loop +1. Create `for_loop.sh` that: + - Loops through a list of 5 fruits and prints each one +Script: + Screenshot 2026-03-08 005057 +Output: + +Screenshot 2026-03-08 005141 + + +2. Create `count.sh` that: + - Prints numbers 1 to 10 using a for loop + + - [Script] + + image + + - Output: + Screenshot 2026-03-08 005425 + +--- + +## Task 2: While Loop +1. Create `countdown.sh` that: + - Takes a number from the user + - Counts down to 0 using a while loop + - Prints "Done!" at the end + + - [Script] + Screenshot 2026-03-08 005908 + + -[Countdown] + Screenshot 2026-03-08 010045 + +--- + +## Task 3: Command-Line Arguments +1. Create `greet.sh` that: + - Accepts a name as `$1` + - Prints `Hello, !` + - If no argument is passed, prints "Usage: ./greet.sh " + + - [Script] + + image + + - OUTPUT + Screenshot 2026-03-08 010915 + +3. Create `args_demo.sh` that: + - Prints total number of arguments (`$#`) + - Prints all arguments (`$@`) + - Prints the script name (`$0`) + + - [Script] + image + + - OUTPUT + image + +--- + +## Task 4: Install Packages via Script +1. Create `install_packages.sh` that: + - Defines a list of packages: `nginx`, `curl`, `wget` + - Loops through the list + - Checks if each package is installed (use `dpkg -s` or `rpm -q`) + - Installs it if missing, skips if already present + - Prints status for each package + + - [Script] + image + + - OUTPUT: + + image + +--- + +## Task 5: Error Handling +1. Create `safe_script.sh` that: + - Uses `set -e` at the top (exit on error) + - Tries to create a directory `/tmp/devops-test` + - Tries to navigate into it + - Creates a file inside + - Uses `||` operator to print an error if any step fails + + - [Script] + image + + - OUTPUT + + image + + +2. Modify your `install_packages.sh` to check if the script is being run as root — exit with a message if not. + + - [Script] + image + + - OUTPUT + + +| **Command (Terminal Prompt)** | **Output in Terminal** | +| ------------------------------ | ----------------------------------------------- | +| `$ ./install_packages.sh` | `Error: Please run this script as root.` | +| `$ sudo ./install_packages.sh` | `Running as root. Starting package check...` | +| | `Checking nginx...` | +| | `Status - nginx is already installed.` | +| | `-----------------------------` | +| | `Checking curl...` | +| | `Status - curl is not installed. Installing...` | +| | `Status - curl installed successfully.` | +| | `-----------------------------` | +| | `Checking wget...` | +| | `Status - wget is already installed.` | +| | `-----------------------------` | + + + + ------------------------ +--- + + +## What I Learned + +* Used for loops to iterate over lists and number ranges +* Used while loops for countdown logic with user input +* Handled command-line arguments using $1, $#, $@, $0 +* Added usage messages for missing arguments +* Took user input using read +* Automated package installation (nginx, curl, wget) +* Checked package status using dpkg -s +* Added root user validation using $EUID +* Implemented error handling with set -e and || +* Created safe scripts to avoid failures and overwrites diff --git a/2026/day-29/docker-basics.md b/2026/day-29/docker-basics.md new file mode 100644 index 0000000000..2a9fc2104e --- /dev/null +++ b/2026/day-29/docker-basics.md @@ -0,0 +1,146 @@ +Task 1: What is Docker? +Docker is an open source containerization platform that allows you to package any application along with dependencies (libraries, environment, configs, runtime) into a container so it runs consistently across environments (dev, test, production). +Screenshot 2026-04-23 163856### + +Simple words: build app; run anywhere +A container is a lightweight, standalone unit that includes: +- Application code +- Runtime (e.g., Python, Node) +- Libraries & dependencies + It runs on top of the host OS but stays isolated from other containers. +Why do we need containers? +Before containers: + +“It works on my machine” problem +Dependency conflicts +Difficult deployments + +- We need for consistency, fast deployment, lightweight, easly scaling + +Q. Containers vs Virtual Machines — what's the real difference? +COntainers vs Virtual can be differntiate for the following features are: + +Virtual Containers- Works on OS-Level doesn't use hardware whereas Virtual machines works on Hardware and software. +Size: Containers size is in MB whereas VM size is in GB +Time: Container starts time is fast in seconds whereas VM starting time is in Minutes. +Resources: Resource usuage take less whereas VM takes much time. +Application Uses: COntainer used for micro-services app but VMs used as a legacy application with running different OS (Linux, Window OS etc) + +Q. What is the Docker architecture? (daemon, client, images, containers, registry) + Docker uses a client–server architecture to build, manage, and run containers. +ChatGPT Image Apr 23, 2026, 04_11_01 PM + + Docker Core Components are: + 1. Docker Client + The tool you interact with (CLI/API) + Example commands: + - docker build + - docker pull + - docker run + Sends requests to the Docker Daemon + 2. Docker Daemon (dockerd) + - The main engine running in the background + It is Responsible for building images, running containers, managing volumes & netowks + 3. Docker Images: + Its blueprint tempalte of container + contains application-code, runtime, install dependencies & libraries + 4. Docker Containers + Docker container has follwing lifecycle + - start + - stop + - Delete + Docker container is running instance of images, and its lightweight and isolated. + 5. Docker Registry + It contains running container both on public and private network + - storing images for locally or docker hub as public repo + 1. Developer runs a command (docker run nginx) + 2. Docker Client sends request to Docker Daemon + 3. Daemon checks local system for image + 4. If not found → pulls image from Registry + 5. Daemon creates and starts Container + 6. Application runs inside container +
    +### Task 2: Install Docker +1. Install Docker on your machine (or use a cloud instance) +I install Ubuntu server +command for installing docker: +sudo apt update -y +sudo apt install -y docker.io +- Start and enable Docker: +sudo systemctl start docker +sudo systemctl enable docker +Run Docker without sudo: +sudo usermod -aG docker $USER docker +Log out and log back in after this +Screenshot 2026-04-23 163054 +Screenshot 2026-04-23 163348 + +2. Step 2: Verify Installation +docker --version +Expected output: +Screenshot 2026-04-23 163506 + +docker info +Screenshot 2026-04-23 163856 + +Step 3: Run Hello World Container +docker run hell-world +image + +Step 4: Understand the Output +What actually happens behind the scenes: +1. Client → Daemon + - Your command goes from Docker Client → Docker Daemon +2. Check for Image Locally + Docker looks for hello-world image on your system + Not found (first time) +3. Pull from Registry + - Docker pulls the image from Docker Hub +4. Create Container + Docker creates a container from the image +5. Run the Container + - The container runs and prints a message + +### Task 3: Run Real Containers +1. Run an Nginx Container + docker run -d -p 8080:80 --name my-nginx nginx + image +2. Run an Ubuntu container in interactive mode — explore it like a mini Linux machine + Screenshot 2026-04-23 165347 +3. List all running containers + Screenshot 2026-04-23 165609 +4. List all containers (including stopped ones) + Screenshot 2026-04-23 165725 +5. Stop and remove a container +Screenshot 2026-04-23 165924 +Screenshot 2026-04-23 170034 +
    +### Task 4: Explore +1. Run a container in detached mode — what's different? +What’s different? +-d = detached mode +Runs in background (no terminal attached) +You get container ID instead of shell +2. Give a container a custom name +docker run -d --name my-nginx nginx +3. Map a port from the container to your host +docker run -d -p 8080:80 --name web nginx +4. Check logs of a running container +docker logs web +Screenshot 2026-04-23 170639 + +5. Run a command inside a running container +docker exec -it web bash +Screenshot 2026-04-23 170720 +
    +Key Concepts (Important) +-d → background execution +--name → easy management +-p → expose container to outside world +logs → debugging +exec → access running container +“In Docker, I can run containers in detached mode using -d, assign custom names using --name, map ports using -p, check logs using docker logs, and execute commands inside a running container using docker exec -it +
    +#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham + +Happy Learning! TrainWithShubham diff --git a/2026/day-30/day-30-images.md b/2026/day-30/day-30-images.md new file mode 100644 index 0000000000..b194a4f2c2 --- /dev/null +++ b/2026/day-30/day-30-images.md @@ -0,0 +1,5 @@ +### Day 30 – Docker Images & Container Lifecycle +
    +Challenge Tasks + +### Task 1: Docker Images diff --git a/2026/day-50/day-50-k8s-setup.md b/2026/day-50/day-50-k8s-setup.md new file mode 100644 index 0000000000..29cf821e18 --- /dev/null +++ b/2026/day-50/day-50-k8s-setup.md @@ -0,0 +1,100 @@ +## Day 50 – Kubernetes Architecture and Cluster Setup +Challenge Tasks +Task 1: Recall the Kubernetes Story +

    +Kubernetes was created to manage containers at scale. Docker can run containers on a single machine, but when applications grow and need to run across multiple servers, Docker alone is not enough. Kubernetes solves this by automating deployment, scaling, networking, and management of containers.

    + +
    +## Task2: Kubernetes Architecture +Kubernetes consists of two main components: +
      +
    • Control Plane
    • +
    • API Server – Handles all requests
    • +
    • Scheduler – Assigns pods to nodes
    • +
    • Controller Manager – Maintains desired state +
    • +
    • etcd – Stores cluster data
    • +
    +
    +image + +
  • +Worker Node +| Component | Description | Key Responsibility | +| --------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| **Kubelet** | Agent running on each worker node | Ensures containers (pods) are running as expected and communicates with the API server | +| **Container Runtime** | Software that runs containers (e.g., containerd, Docker) | Pulls images and runs containers inside pods | +| **Kube Proxy** | Network component on each node | Manages networking rules and enables communication between services and pods | + +
    + ## Cluster Setup + +
      Tool Used +
    • Kind (Kubernetes IN Docker)
    • +
    • Steps for Setting up
    • +
    + +### Task 3: Install kubectl +# macOS +brew install kubectl +brew install docker --cask docker + +Screenshot 2026-03-27 at 10 50 29 PM +
    +### Step 3: Create Kubernetes Cluster + + +[Kind-config](./kind-config.yml) + +📄 View Screenshot: [Cluster Output](./screenshot/cluster.pdf) + +
    + + +
    +### Step 4: Verify Cluster +kubectl get nodes +### Task 5: Explore Your Cluster +# See cluster info +kubectl cluster-info +📄 View Screenshot: [Cluster Output](./screenshot/cluster-info.pdf) +# List all nodes +kubectl get nodes + +# Get detailed info about your node +kubectl describe node + +# List all namespaces +kubectl get namespaces + +### See ALL pods running in the cluster (across all namespaces) + +kubectl get pods -A + +Look at the pods running in the kube-system namespace: + +kubectl get pods -n kube-system + +📄 View Screenshot: [Cluster Output](./screenshot/kube-system.pdf) + +
    +#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham + + + + + + + + + + + + + + + + + + + diff --git a/2026/day-50/kind-config.yml b/2026/day-50/kind-config.yml new file mode 100644 index 0000000000..e2c39f2805 --- /dev/null +++ b/2026/day-50/kind-config.yml @@ -0,0 +1,20 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + image: kindest/node:v1.33.1 + - role: worker + image: kindest/node:v1.33.1 + - role: worker + image: kindest/node:v1.33.1 + + - role: worker + image: kindest/node:v1.33.1 + + extraPortMappings: + - containerPort: 8080 + hostPort: 8080 + protocol: TCP + - containerPort: 8443 + hostPort: 8443 + protocol: TCP \ No newline at end of file diff --git a/2026/day-50/screenshot . b/2026/day-50/screenshot . new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/2026/day-50/screenshot . @@ -0,0 +1 @@ + diff --git a/2026/day-50/screenshot/Cluster-info.pdf b/2026/day-50/screenshot/Cluster-info.pdf new file mode 100644 index 0000000000..8da135e809 Binary files /dev/null and b/2026/day-50/screenshot/Cluster-info.pdf differ diff --git a/2026/day-50/screenshot/cluster.pdf b/2026/day-50/screenshot/cluster.pdf new file mode 100644 index 0000000000..1ccd81cbcc Binary files /dev/null and b/2026/day-50/screenshot/cluster.pdf differ diff --git a/2026/day-50/screenshot/cluster.png b/2026/day-50/screenshot/cluster.png new file mode 100644 index 0000000000..4b6b0f68c6 Binary files /dev/null and b/2026/day-50/screenshot/cluster.png differ diff --git a/2026/day-50/screenshot/kube-system.pdf b/2026/day-50/screenshot/kube-system.pdf new file mode 100644 index 0000000000..b93beea3e7 Binary files /dev/null and b/2026/day-50/screenshot/kube-system.pdf differ diff --git a/2026/day-51/busybox-pod.yml b/2026/day-51/busybox-pod.yml new file mode 100644 index 0000000000..247dbeb0ac --- /dev/null +++ b/2026/day-51/busybox-pod.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Pod +metadata: + name: busybox-pod + labels: + app: busybox + environment: dev +spec: + containers: + - name: busybox + image: busybox:latest + command: ["sh", "-c", "echo Hello from BusyBox && sleep 3600"] diff --git a/2026/day-51/day-51-pods.md b/2026/day-51/day-51-pods.md new file mode 100644 index 0000000000..d9256bff0b --- /dev/null +++ b/2026/day-51/day-51-pods.md @@ -0,0 +1,39 @@ +### Day 51 – Kubernetes Manifests and Your First Pods + +### Task 1: Create Your First Pod (Nginx) +Create a file called nginx-pod.yaml: +📄 View Screenshot: [Nginx file](nginx-pod.yml) + +kubectl apply -f nginx-pod.yaml +##### Verify: + +kubectl get pods +kubectl get pods -o wide +Wait until the STATUS shows Running. Then explore: + +#### Detailed info about the pod +kubectl describe pod nginx-pod + +#### Read the logs +kubectl logs nginx-pod + +##### Get a shell inside the container +kubectl exec -it nginx-pod -- /bin/bash + +#### Inside the container, run: +curl localhost:80 +exit +📄 View Screenshot: [Nginx file](nginx-status.pdf) + +### Task 2: Create a Custom Pod (BusyBox) +Write a new manifest busybox-pod.yaml from scratch (do not copy-paste the nginx one): + [Nginx file](busyboxpod.yml) + +kubectl apply -f busybox-pod.yaml +kubectl get pods +kubectl logs busybox-pod + + + + + diff --git a/2026/day-51/mynginx-pod.pdf b/2026/day-51/mynginx-pod.pdf new file mode 100644 index 0000000000..61a61cbbb4 Binary files /dev/null and b/2026/day-51/mynginx-pod.pdf differ diff --git a/2026/day-51/nginx-pod-exec.pdf b/2026/day-51/nginx-pod-exec.pdf new file mode 100644 index 0000000000..c0b6c1c66b Binary files /dev/null and b/2026/day-51/nginx-pod-exec.pdf differ diff --git a/2026/day-51/nginx-pod-logs.pdf b/2026/day-51/nginx-pod-logs.pdf new file mode 100644 index 0000000000..4bd392a238 Binary files /dev/null and b/2026/day-51/nginx-pod-logs.pdf differ diff --git a/2026/day-51/nginx-pod.yml b/2026/day-51/nginx-pod.yml new file mode 100644 index 0000000000..49a9082b46 --- /dev/null +++ b/2026/day-51/nginx-pod.yml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: my-pod + labels: + app: nginx + +spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 \ No newline at end of file diff --git a/2026/day-51/nginx-podstatus.pdf b/2026/day-51/nginx-podstatus.pdf new file mode 100644 index 0000000000..7d479250b7 Binary files /dev/null and b/2026/day-51/nginx-podstatus.pdf differ diff --git a/2026/day-68/day-68-ansible-intro.md b/2026/day-68/day-68-ansible-intro.md new file mode 100644 index 0000000000..a039f50c1a --- /dev/null +++ b/2026/day-68/day-68-ansible-intro.md @@ -0,0 +1,175 @@ +### Day 68 -- Introduction to Ansible and Inventory Setup +##### Challenge Tasks +#### Task 1: Understand Ansible +Research and write short notes on: + +Q1. What is configuration management? Why do we need it? +Configuration Management is a systematic DevOps tools is to manage the server configuration, installing required packages for web servers to run for applications. Configuration Management is a way to ensure that your systems(servers,software and other os peripherical devices) always match a "desired state" or baseline. + +Instead of installing & configuring packages manually in each system or nodes, we define the desired setup and apply it automatically using tools like Ansible, chef, puppet. + +Why do we need it? +Without configuration management, complex IT environments quickly experience "configuration drift," where systems gradually deviate from their intended settings, leading to unpredictable failures. Key reasons for its importance. +- Reliability & Uptime: By ensuring consistency between development, testing, and production environments, CM prevents "it worked on my machine" errors and reduces costly outages. +- Security & Compliance: It helps close security holes by ensuring critical patches are applied and default insecure settings are changed. +- Scalability: Automated tools (like Ansible, Puppet, or Terraform) allow teams to manage hundreds or thousands of servers with the same effort it takes to manage one. +- Efficiency: Automation reduces repetitive manual tasks, freeing up staff to focus on innovation rather than "firefighting" configuration errors + +Q2. How is Ansible different from Chef, Puppet, and Salt? +Ansible is different because of following reasons: +- Ansible: If you want to get started quickly without managing agent software. It's excellent for "orchestration"—running tasks in a specific order across multiple machines. +- Chef: Ideal for "development-centric" teams who are comfortable writing actual code (Ruby) to manage their infrastructure. +- Puppet: The most "mature" choice for massive, heterogeneous environments where you need strict, declarative state management and detailed reporting. +- SaltStack: Best for speed. It uses a high-performance messaging system (ZeroMQ) that can push changes to thousands of servers almost instantly. + +Q3. What does "agentless" mean? How does Ansible connect to managed nodes? + +In the context of configuration management, agentless means you do not need to install or maintain any proprietary software (agents) on the servers you want to manage. Instead of having a background service constantly running on the target machine, the management tool connect it only when needed, performs its tasks, and then disconnects. + +- How Ansible Connects: +Ansible uses existing, standard communication protocols that are already built into most operating systems to manage nodes: + +- For Linux/Unix Nodes (SSH): Ansible connects primarily via Secure Shell (SSH). By default, it assumes you are using SSH keys for passwordless authentication, though it can also use standard passwords with the --ask-pass flag. +- For Windows Nodes (WinRM or SSH): +WinRM: Traditionally, Ansible uses Windows Remote Management (WinRM), which communicates over HTTP/HTTPS. +SSH: On modern Windows versions (Server 2019+ and Windows 10+), Ansible officially supports SSH as a faster and more secure alternative to WinRM. + +- For Network Devices: Ansible can connect to routers and switches using standard protocols like SSH, NETCONF, or specific APIs provided by the manufacturer. + The Execution Process: + + When you run a command or playbook, Ansible follows this "push-based" flow: +- Connects: The control node initiates an SSH or WinRM connection to the target. +- Transfers: It pushes small, temporary programs called modules (usually Python-based) to the remote machine. +- Executes: The remote machine runs these modules locally. +- Cleans Up: Once the task is finished, Ansible removes the temporary modules and closes the connection. + +
    + + +#### Task 2: Set Up Your Lab Environment +You need 2-3 EC2 instances to practice on. Choose one approach: + +Option A: Use Terraform (recommended -- you just learned this) Use your TerraWeek skills to provision 3 EC2 instances with: + +Amazon Linux 2 or Ubuntu 22.04 +t2.micro instance type iam taking t3.micro because on my account t2.micro N/A +A security group allowing SSH (port 22) +A key pair for SSH access +Option B: Launch manually from AWS Console Create 3 instances with the same specs above. +ssh -i ~/your-key.pem ec2-user@ +ssh -i ~/your-key.pem ec2-user@ +ssh -i ~/your-key.pem ec2-user@ + +Screenshot (57)


    + + + + +- Instance 1: web server +- Instance 2: app server + +- Instance 3: db server + +Verify you can SSH into each one from your control node: +ssh -i ~/your-key.pem ec2-user@ +ssh -i ~/your-key.pem ec2-user@ +ssh -i ~/your-key.pem ec2-user@ +Screenshot 2026-04-08 at 10 21 02 PM + Screenshot 2026-04-08 at 8 26 42 PM + + + +Screenshot 2026-04-08 at 10 13 27 PM + + + + +#### Task 3: Install Ansible +Install Ansible on your control node (your laptop or one dedicated EC2 instance): +- macOS +brew install ansible + +- Ubuntu/Debian +sudo apt update +sudo apt install ansible -y + +- Amazon Linux / RHEL +sudo yum install ansible -y +- or +pip3 install ansible + +- Verify +ansible --version +task4 +
    +### Task 4: Create Your Inventory File +The inventory tells Ansible which servers to manage. Create a project directory and your first inventory: + + +Screenshot 2026-04-08 at 10 56 39 PM + +Troubleshoot: If ping fails: + +Check the SSH key path and permissions (chmod 400 your-key.pem) +Check the security group allows SSH from your IP +Check the ansible_user matches your AMI (ec2-user for Amazon Linux, ubuntu for Ubuntu) + + +#### Task 5: Run Ad-Hoc Commands +Ad-hoc commands let you run quick one-off tasks without writing a playbook. + +- Check uptime on all servers: +ansible all -i inventory.ini -m command -a "uptime" + +Screenshot 2026-04-08 at 10 59 54 PM + +- Check free memory on web servers only: +ansible web -i inventory.ini -m command -a "free -h" + +ansible all -i inventory.ini -m command -a "df -h" + +Screenshot 2026-04-08 at 11 04 12 PM + +- Install a package on the web group: +ansible web -i inventory.ini -m yum -a "name=git state=present" --become + +Screenshot 2026-04-08 at 11 07 34 PM + +- Copy a file to all servers: +echo "Hello from Ansible" > hello.txt +ansible all -i inventory.ini -m copy -a "src=hello.txt dest=/tmp/hello.txt" + +Screenshot 2026-04-08 at 11 11 10 PM 1 + + +- Verify the file was copied: +ansible all -i inventory.ini -m command -a "cat /tmp/hello.txt" +Screenshot 2026-04-08 at 11 12 53 PM +
    +#### Task 6: Explore Inventory Groups and Patterns + +Create a group of groups -- add this to your inventory.ini: +[application:children] +web +app + +[all_servers:children] +application +db + +- Run commands against different groups: +ansible application -i inventory.ini -m ping # web + app servers +ansible db -i inventory.ini -m ping # only db server +ansible all_servers -i inventory.ini -m ping # everything + +Screenshot 2026-04-08 at 11 18 48 PM + + + + + + + + + + diff --git a/2026/day-68/terraform/.gitignore b/2026/day-68/terraform/.gitignore new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/2026/day-68/terraform/.gitignore @@ -0,0 +1 @@ + diff --git a/2026/day-68/terraform/ansible-terra-key b/2026/day-68/terraform/ansible-terra-key new file mode 100644 index 0000000000..930802b1f5 --- /dev/null +++ b/2026/day-68/terraform/ansible-terra-key @@ -0,0 +1,8 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACBzs6nJoiMOEmTMb3QKNVDCKdVLKA3HzKfnOMegYguJNwAAAKi1oU0StaFN +EgAAAAtzc2gtZWQyNTUxOQAAACBzs6nJoiMOEmTMb3QKNVDCKdVLKA3HzKfnOMegYguJNw +AAAEDLku94UVCDoXEVAhJjSqLTgDnZ9PhL5v2YY9vDKq8pBXOzqcmiIw4SZMxvdAo1UMIp +1UsoDcfMp+c4x6BiC4k3AAAAJHByaXlhbmthQFByaXlhbmthcy1NYWNCb29rLUFpci5sb2 +NhbAE= +-----END OPENSSH PRIVATE KEY----- diff --git a/2026/day-68/terraform/ansible-terra-key.pub b/2026/day-68/terraform/ansible-terra-key.pub new file mode 100644 index 0000000000..94da0e1073 --- /dev/null +++ b/2026/day-68/terraform/ansible-terra-key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHOzqcmiIw4SZMxvdAo1UMIp1UsoDcfMp+c4x6BiC4k3 priyanka@Priyankas-MacBook-Air.local diff --git a/2026/day-68/terraform/ec2.tf b/2026/day-68/terraform/ec2.tf new file mode 100644 index 0000000000..95dc3f2665 --- /dev/null +++ b/2026/day-68/terraform/ec2.tf @@ -0,0 +1,86 @@ +resource aws_key_pair my_key_pair { + +key_name="ansible-terra-key" +public_key=file("ansible-terra-key.pub") +} + +# VPC Default + +resource aws_default_vpc default { +} + +# Security Group + +resource aws_security_group my_security_group { +name="terra-security-group" +vpc_id= aws_default_vpc.default.id # interpolation +description = "this is Inbound and outbound rules for your instance Security group" + +} + +# Inbound & Outbount port rules +resource aws_vpc_security_group_ingress_rule allow_http { + security_group_id = aws_security_group.my_security_group.id + cidr_ipv4 = "0.0.0.0/0" + from_port = 80 + ip_protocol = "tcp" + to_port = 80 +} + +resource aws_vpc_security_group_ingress_rule allow_ssh { + security_group_id = aws_security_group.my_security_group.id + cidr_ipv4 = "0.0.0.0/0" + from_port = 22 + ip_protocol = "tcp" + to_port = 22 +} + + +resource aws_vpc_security_group_egress_rule allow_all_traffic { + security_group_id = aws_security_group.my_security_group.id + cidr_ipv4 = "0.0.0.0/0" + ip_protocol = "-1" # semantically equivalent to all ports +} + + +# EC2 instance + + resource aws_instance my_instance { + ## getting dynamic instances with key & values + for_each = var.instances + ami=each.value.ami + instance_type = each.value.instance_type + key_name = aws_key_pair.my_key_pair.key_name + + vpc_security_group_ids = [ + aws_security_group.my_security_group.id + ] + root_block_device { + volume_size = 10 + volume_type = "gp3" + } + +/* + count = 3 + ami = "ami-0d76b909de1a0595d" # OS AMI ID + + instance_type = "t3.micro" # Instance Type + + key_name = aws_key_pair.my_key_pair.key_name # Key pair + + vpc_security_group_ids = [aws_security_group.my_security_group.id] # VPC & Security Group + + # root storage (EBS) + root_block_device { + volume_size = 10 + volume_type = "gp3" + } + + tags = { + Name = "terra-automate-server" + } */ + tags={ + Name= each.key + OS_family=each.value.os_family + } +} \ No newline at end of file diff --git a/2026/day-68/terraform/generate_hosts.tf b/2026/day-68/terraform/generate_hosts.tf new file mode 100644 index 0000000000..a240a15812 --- /dev/null +++ b/2026/day-68/terraform/generate_hosts.tf @@ -0,0 +1,11 @@ +#TODO +/* resource "local_file" "my_host_file" { +filename= "hosts" + content={ + for name, instance in aws_instance.my_instance: name=> { + public_ip=instance.public_ip + user=var.instances[name].user + + } +} +} */ diff --git a/2026/day-68/terraform/outputs.tf b/2026/day-68/terraform/outputs.tf new file mode 100644 index 0000000000..0f05d7b3f9 --- /dev/null +++ b/2026/day-68/terraform/outputs.tf @@ -0,0 +1,11 @@ +output "instance_details" { + description = "Public IPs and SSH users for each instance" + value = { + for name, instance in aws_instance.my_instance : name => { + public_ip = instance.public_ip + public_dns = instance.public_dns + ssh_user = var.instances[name].user + os_family = var.instances[name].os_family + } + } +} \ No newline at end of file diff --git a/2026/day-68/terraform/providers.tf b/2026/day-68/terraform/providers.tf new file mode 100644 index 0000000000..c0583a7860 --- /dev/null +++ b/2026/day-68/terraform/providers.tf @@ -0,0 +1,5 @@ +provider "aws" { + + region="us-west-2" + +} \ No newline at end of file diff --git a/2026/day-68/terraform/terraform.tf b/2026/day-68/terraform/terraform.tf new file mode 100644 index 0000000000..0cedae8f9b --- /dev/null +++ b/2026/day-68/terraform/terraform.tf @@ -0,0 +1,11 @@ +terraform { + + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.39.0" + } + } +} + + diff --git a/2026/day-68/terraform/terraform.tfstate b/2026/day-68/terraform/terraform.tfstate new file mode 100644 index 0000000000..f37751c9ad --- /dev/null +++ b/2026/day-68/terraform/terraform.tfstate @@ -0,0 +1,960 @@ +{ + "version": 4, + "terraform_version": "1.14.8", + "serial": 102, + "lineage": "81ca0427-a01c-ce4d-8a82-11a1de99a847", + "outputs": { + "instance_details": { + "value": { + "app-server": { + "os_family": "redhat", + "public_dns": "ec2-34-221-61-140.us-west-2.compute.amazonaws.com", + "public_ip": "34.221.61.140", + "ssh_user": "ec2-user" + }, + "control-node": { + "os_family": "ubuntu", + "public_dns": "ec2-35-93-211-243.us-west-2.compute.amazonaws.com", + "public_ip": "35.93.211.243", + "ssh_user": "ubuntu" + }, + "db-server": { + "os_family": "redhat", + "public_dns": "ec2-34-210-79-56.us-west-2.compute.amazonaws.com", + "public_ip": "34.210.79.56", + "ssh_user": "ec2-user" + }, + "web-server": { + "os_family": "amazon", + "public_dns": "ec2-44-252-105-156.us-west-2.compute.amazonaws.com", + "public_ip": "44.252.105.156", + "ssh_user": "ec2-user" + } + }, + "type": [ + "object", + { + "app-server": [ + "object", + { + "os_family": "string", + "public_dns": "string", + "public_ip": "string", + "ssh_user": "string" + } + ], + "control-node": [ + "object", + { + "os_family": "string", + "public_dns": "string", + "public_ip": "string", + "ssh_user": "string" + } + ], + "db-server": [ + "object", + { + "os_family": "string", + "public_dns": "string", + "public_ip": "string", + "ssh_user": "string" + } + ], + "web-server": [ + "object", + { + "os_family": "string", + "public_dns": "string", + "public_ip": "string", + "ssh_user": "string" + } + ] + } + ] + } + }, + "resources": [ + { + "mode": "managed", + "type": "aws_default_vpc", + "name": "default", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:vpc/vpc-0cbf157632debbde9", + "assign_generated_ipv6_cidr_block": false, + "cidr_block": "172.31.0.0/16", + "default_network_acl_id": "acl-050afbafd1743c46b", + "default_route_table_id": "rtb-08901d1c15584c3bb", + "default_security_group_id": "sg-0589da029675a1a17", + "dhcp_options_id": "dopt-036434adc6558e467", + "enable_dns_hostnames": true, + "enable_dns_support": true, + "enable_network_address_usage_metrics": false, + "existing_default_vpc": true, + "force_destroy": false, + "id": "vpc-0cbf157632debbde9", + "instance_tenancy": "default", + "ipv6_association_id": "", + "ipv6_cidr_block": "", + "ipv6_cidr_block_network_border_group": "", + "ipv6_ipam_pool_id": "", + "ipv6_netmask_length": 0, + "main_route_table_id": "rtb-08901d1c15584c3bb", + "owner_id": "822923364368", + "region": "us-west-2", + "tags": {}, + "tags_all": {} + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==" + } + ] + }, + { + "mode": "managed", + "type": "aws_instance", + "name": "my_instance", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "index_key": "app-server", + "schema_version": 2, + "attributes": { + "ami": "ami-04c7815cd1d6c8fa4", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0727ad3c7a4ba2e27", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0727ad3c7a4ba2e27", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "ansible-terra-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 1, + "http_tokens": "optional", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-0f4e54d12cc57aff9" + } + ], + "primary_network_interface_id": "eni-0f4e54d12cc57aff9", + "private_dns": "ip-172-31-42-176.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.42.176", + "public_dns": "ec2-34-221-61-140.us-west-2.compute.amazonaws.com", + "public_ip": "34.221.61.140", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/sda1", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-0a9df64e9db7fe61b", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "app-server", + "OS_family": "redhat" + }, + "tags_all": { + "Name": "app-server", + "OS_family": "redhat" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0727ad3c7a4ba2e27", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + }, + { + "index_key": "control-node", + "schema_version": 2, + "attributes": { + "ami": "ami-0d76b909de1a0595d", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0e10bdd616df7b0d0", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0e10bdd616df7b0d0", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "ansible-terra-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 2, + "http_tokens": "required", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-048dcec87cecd0073" + } + ], + "primary_network_interface_id": "eni-048dcec87cecd0073", + "private_dns": "ip-172-31-35-114.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.35.114", + "public_dns": "ec2-35-93-211-243.us-west-2.compute.amazonaws.com", + "public_ip": "35.93.211.243", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/sda1", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-0f85d82afc590d4fe", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "control-node", + "OS_family": "ubuntu" + }, + "tags_all": { + "Name": "control-node", + "OS_family": "ubuntu" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0e10bdd616df7b0d0", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + }, + { + "index_key": "db-server", + "schema_version": 2, + "attributes": { + "ami": "ami-04c7815cd1d6c8fa4", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0c51bd43bb629d990", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0c51bd43bb629d990", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "ansible-terra-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 1, + "http_tokens": "optional", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-08b271a35565af505" + } + ], + "primary_network_interface_id": "eni-08b271a35565af505", + "private_dns": "ip-172-31-47-84.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.47.84", + "public_dns": "ec2-34-210-79-56.us-west-2.compute.amazonaws.com", + "public_ip": "34.210.79.56", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/sda1", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-0d0321ce84f04edd0", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "db-server", + "OS_family": "redhat" + }, + "tags_all": { + "Name": "db-server", + "OS_family": "redhat" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0c51bd43bb629d990", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + }, + { + "index_key": "web-server", + "schema_version": 2, + "attributes": { + "ami": "ami-043ab4148b7bb33e9", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0cb11e3966c5313a6", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0cb11e3966c5313a6", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "ansible-terra-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 2, + "http_tokens": "required", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-0ec4f1c8839c2626e" + } + ], + "primary_network_interface_id": "eni-0ec4f1c8839c2626e", + "private_dns": "ip-172-31-35-209.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.35.209", + "public_dns": "ec2-44-252-105-156.us-west-2.compute.amazonaws.com", + "public_ip": "44.252.105.156", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/xvda", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-071d2fa3251d30159", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "web-server", + "OS_family": "amazon" + }, + "tags_all": { + "Name": "web-server", + "OS_family": "amazon" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0cb11e3966c5313a6", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_key_pair", + "name": "my_key_pair", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:key-pair/ansible-terra-key", + "fingerprint": "OhCgiKyqLkRx8Fr5sqmlfuiSv1rsCrBygrM4jt6yNkA=", + "id": "ansible-terra-key", + "key_name": "ansible-terra-key", + "key_name_prefix": "", + "key_pair_id": "key-0d4354db8c1de8d59", + "key_type": "ed25519", + "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHOzqcmiIw4SZMxvdAo1UMIp1UsoDcfMp+c4x6BiC4k3 priyanka@Priyankas-MacBook-Air.local", + "region": "us-west-2", + "tags": null, + "tags_all": {} + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==" + } + ] + }, + { + "mode": "managed", + "type": "aws_security_group", + "name": "my_security_group", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group/sg-0a2386ce249a576a1", + "description": "this is Inbound and outbound rules for your instance Security group", + "egress": [ + { + "cidr_blocks": [ + "0.0.0.0/0" + ], + "description": "", + "from_port": 0, + "ipv6_cidr_blocks": [], + "prefix_list_ids": [], + "protocol": "-1", + "security_groups": [], + "self": false, + "to_port": 0 + } + ], + "id": "sg-0a2386ce249a576a1", + "ingress": [ + { + "cidr_blocks": [ + "0.0.0.0/0" + ], + "description": "", + "from_port": 22, + "ipv6_cidr_blocks": [], + "prefix_list_ids": [], + "protocol": "tcp", + "security_groups": [], + "self": false, + "to_port": 22 + }, + { + "cidr_blocks": [ + "0.0.0.0/0" + ], + "description": "", + "from_port": 443, + "ipv6_cidr_blocks": [], + "prefix_list_ids": [], + "protocol": "tcp", + "security_groups": [], + "self": false, + "to_port": 443 + }, + { + "cidr_blocks": [ + "0.0.0.0/0" + ], + "description": "", + "from_port": 80, + "ipv6_cidr_blocks": [], + "prefix_list_ids": [], + "protocol": "tcp", + "security_groups": [], + "self": false, + "to_port": 80 + } + ], + "name": "terra-security-group", + "name_prefix": "", + "owner_id": "822923364368", + "region": "us-west-2", + "revoke_rules_on_delete": false, + "tags": {}, + "tags_all": {}, + "timeouts": null, + "vpc_id": "vpc-0cbf157632debbde9" + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sg-0a2386ce249a576a1", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=", + "dependencies": [ + "aws_default_vpc.default" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_egress_rule", + "name": "allow_all_traffic", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-01c07a4e05ff9dd98", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": null, + "id": "sgr-01c07a4e05ff9dd98", + "ip_protocol": "-1", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-01c07a4e05ff9dd98", + "tags": null, + "tags_all": {}, + "to_port": null + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-01c07a4e05ff9dd98", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_ingress_rule", + "name": "allow_http", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-05a12ccaa52e03a1c", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": 80, + "id": "sgr-05a12ccaa52e03a1c", + "ip_protocol": "tcp", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-05a12ccaa52e03a1c", + "tags": null, + "tags_all": {}, + "to_port": 80 + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-05a12ccaa52e03a1c", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_ingress_rule", + "name": "allow_ssh", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-0d12aad10c53974a3", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": 22, + "id": "sgr-0d12aad10c53974a3", + "ip_protocol": "tcp", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-0d12aad10c53974a3", + "tags": null, + "tags_all": {}, + "to_port": 22 + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-0d12aad10c53974a3", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + } + ], + "check_results": null +} diff --git a/2026/day-68/terraform/terraform.tfstate.backup b/2026/day-68/terraform/terraform.tfstate.backup new file mode 100644 index 0000000000..8767104ce8 --- /dev/null +++ b/2026/day-68/terraform/terraform.tfstate.backup @@ -0,0 +1,730 @@ +{ + "version": 4, + "terraform_version": "1.14.8", + "serial": 95, + "lineage": "81ca0427-a01c-ce4d-8a82-11a1de99a847", + "outputs": { + "public_ip": { + "value": { + "control-node": { + "public_ip": "34.210.72.48", + "user": "ubuntu" + }, + "worker-amazon": { + "public_ip": "35.91.50.51", + "user": "ec2-user" + }, + "worker-redhat": { + "public_ip": "44.250.68.8", + "user": "ec2-user" + } + }, + "type": [ + "object", + { + "control-node": [ + "object", + { + "public_ip": "string", + "user": "string" + } + ], + "worker-amazon": [ + "object", + { + "public_ip": "string", + "user": "string" + } + ], + "worker-redhat": [ + "object", + { + "public_ip": "string", + "user": "string" + } + ] + } + ] + } + }, + "resources": [ + { + "mode": "managed", + "type": "aws_default_vpc", + "name": "default", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:vpc/vpc-0cbf157632debbde9", + "assign_generated_ipv6_cidr_block": false, + "cidr_block": "172.31.0.0/16", + "default_network_acl_id": "acl-050afbafd1743c46b", + "default_route_table_id": "rtb-08901d1c15584c3bb", + "default_security_group_id": "sg-0589da029675a1a17", + "dhcp_options_id": "dopt-036434adc6558e467", + "enable_dns_hostnames": true, + "enable_dns_support": true, + "enable_network_address_usage_metrics": false, + "existing_default_vpc": true, + "force_destroy": false, + "id": "vpc-0cbf157632debbde9", + "instance_tenancy": "default", + "ipv6_association_id": "", + "ipv6_cidr_block": "", + "ipv6_cidr_block_network_border_group": "", + "ipv6_ipam_pool_id": "", + "ipv6_netmask_length": 0, + "main_route_table_id": "rtb-08901d1c15584c3bb", + "owner_id": "822923364368", + "region": "us-west-2", + "tags": null, + "tags_all": {} + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==" + } + ] + }, + { + "mode": "managed", + "type": "aws_instance", + "name": "my_instance", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "index_key": "control-node", + "schema_version": 2, + "attributes": { + "ami": "ami-0d76b909de1a0595d", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0bb6ffcfcd3058c3f", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0bb6ffcfcd3058c3f", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "terra-automate-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 2, + "http_tokens": "required", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-0043de5de9ce522b5" + } + ], + "primary_network_interface_id": "eni-0043de5de9ce522b5", + "private_dns": "ip-172-31-36-10.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.36.10", + "public_dns": "ec2-34-210-72-48.us-west-2.compute.amazonaws.com", + "public_ip": "34.210.72.48", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/sda1", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-08690b2d328c03247", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "control-node", + "OS_family": "ubuntu" + }, + "tags_all": { + "Name": "control-node", + "OS_family": "ubuntu" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0bb6ffcfcd3058c3f", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + }, + { + "index_key": "worker-amazon", + "schema_version": 2, + "attributes": { + "ami": "ami-043ab4148b7bb33e9", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-0908934e26a3145d8", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-0908934e26a3145d8", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "terra-automate-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 2, + "http_tokens": "required", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-0387122a4fb139053" + } + ], + "primary_network_interface_id": "eni-0387122a4fb139053", + "private_dns": "ip-172-31-44-92.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.44.92", + "public_dns": "ec2-35-91-50-51.us-west-2.compute.amazonaws.com", + "public_ip": "35.91.50.51", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/xvda", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-01535695e4ba08081", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "worker-amazon", + "OS_family": "amazon" + }, + "tags_all": { + "Name": "worker-amazon", + "OS_family": "amazon" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-0908934e26a3145d8", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + }, + { + "index_key": "worker-redhat", + "schema_version": 2, + "attributes": { + "ami": "ami-04c7815cd1d6c8fa4", + "arn": "arn:aws:ec2:us-west-2:822923364368:instance/i-07ee16e48e3002075", + "associate_public_ip_address": true, + "availability_zone": "us-west-2a", + "capacity_reservation_specification": [ + { + "capacity_reservation_preference": "open", + "capacity_reservation_target": [] + } + ], + "cpu_options": [ + { + "amd_sev_snp": "", + "core_count": 1, + "nested_virtualization": "", + "threads_per_core": 2 + } + ], + "credit_specification": [ + { + "cpu_credits": "unlimited" + } + ], + "disable_api_stop": false, + "disable_api_termination": false, + "ebs_block_device": [], + "ebs_optimized": false, + "enable_primary_ipv6": null, + "enclave_options": [ + { + "enabled": false + } + ], + "ephemeral_block_device": [], + "force_destroy": false, + "get_password_data": false, + "hibernation": false, + "host_id": "", + "host_resource_group_arn": null, + "iam_instance_profile": "", + "id": "i-07ee16e48e3002075", + "instance_initiated_shutdown_behavior": "stop", + "instance_lifecycle": "", + "instance_market_options": [], + "instance_state": "running", + "instance_type": "t3.micro", + "ipv6_address_count": 0, + "ipv6_addresses": [], + "key_name": "terra-automate-key", + "launch_template": [], + "maintenance_options": [ + { + "auto_recovery": "default" + } + ], + "metadata_options": [ + { + "http_endpoint": "enabled", + "http_protocol_ipv6": "disabled", + "http_put_response_hop_limit": 1, + "http_tokens": "optional", + "instance_metadata_tags": "disabled" + } + ], + "monitoring": false, + "network_interface": [], + "outpost_arn": "", + "password_data": "", + "placement_group": "", + "placement_group_id": "", + "placement_partition_number": 0, + "primary_network_interface": [ + { + "delete_on_termination": true, + "network_interface_id": "eni-04c08f15c9efe0390" + } + ], + "primary_network_interface_id": "eni-04c08f15c9efe0390", + "private_dns": "ip-172-31-44-100.us-west-2.compute.internal", + "private_dns_name_options": [ + { + "enable_resource_name_dns_a_record": false, + "enable_resource_name_dns_aaaa_record": false, + "hostname_type": "ip-name" + } + ], + "private_ip": "172.31.44.100", + "public_dns": "ec2-44-250-68-8.us-west-2.compute.amazonaws.com", + "public_ip": "44.250.68.8", + "region": "us-west-2", + "root_block_device": [ + { + "delete_on_termination": true, + "device_name": "/dev/sda1", + "encrypted": false, + "iops": 3000, + "kms_key_id": "", + "tags": null, + "tags_all": {}, + "throughput": 125, + "volume_id": "vol-08388cab68c9f5c07", + "volume_size": 10, + "volume_type": "gp3" + } + ], + "secondary_network_interface": [], + "secondary_private_ips": [], + "security_groups": [ + "terra-security-group" + ], + "source_dest_check": true, + "spot_instance_request_id": "", + "subnet_id": "subnet-011d9992f679688e5", + "tags": { + "Name": "worker-redhat", + "OS_family": "redhat" + }, + "tags_all": { + "Name": "worker-redhat", + "OS_family": "redhat" + }, + "tenancy": "default", + "timeouts": null, + "user_data": null, + "user_data_base64": null, + "user_data_replace_on_change": false, + "volume_tags": null, + "vpc_security_group_ids": [ + "sg-0a2386ce249a576a1" + ] + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "i-07ee16e48e3002075", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", + "dependencies": [ + "aws_default_vpc.default", + "aws_key_pair.my_key_pair", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_key_pair", + "name": "my_key_pair", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:key-pair/terra-automate-key", + "fingerprint": "ZqRpP1AKvybE60rJJjVYupG0JR9WQ95fFgHYUUD2jSI=", + "id": "terra-automate-key", + "key_name": "terra-automate-key", + "key_name_prefix": "", + "key_pair_id": "key-0bc8c3618dd15240d", + "key_type": "ed25519", + "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFT2C2YpF5D3+oI6x77CUfc3xSUZY/2ol9mKWPBHjLN2 priyanka@Priyankas-MacBook-Air.local", + "region": "us-west-2", + "tags": null, + "tags_all": {} + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==" + } + ] + }, + { + "mode": "managed", + "type": "aws_security_group", + "name": "my_security_group", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group/sg-0a2386ce249a576a1", + "description": "this is Inbound and outbound rules for your instance Security group", + "egress": [], + "id": "sg-0a2386ce249a576a1", + "ingress": [], + "name": "terra-security-group", + "name_prefix": "", + "owner_id": "822923364368", + "region": "us-west-2", + "revoke_rules_on_delete": false, + "tags": null, + "tags_all": {}, + "timeouts": null, + "vpc_id": "vpc-0cbf157632debbde9" + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sg-0a2386ce249a576a1", + "region": "us-west-2" + }, + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=", + "dependencies": [ + "aws_default_vpc.default" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_egress_rule", + "name": "allow_all_traffic", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-01c07a4e05ff9dd98", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": null, + "id": "sgr-01c07a4e05ff9dd98", + "ip_protocol": "-1", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-01c07a4e05ff9dd98", + "tags": null, + "tags_all": {}, + "to_port": null + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-01c07a4e05ff9dd98", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_ingress_rule", + "name": "allow_http", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-05a12ccaa52e03a1c", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": 80, + "id": "sgr-05a12ccaa52e03a1c", + "ip_protocol": "tcp", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-05a12ccaa52e03a1c", + "tags": null, + "tags_all": {}, + "to_port": 80 + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-05a12ccaa52e03a1c", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc_security_group_ingress_rule", + "name": "allow_ssh", + "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-west-2:822923364368:security-group-rule/sgr-0d12aad10c53974a3", + "cidr_ipv4": "0.0.0.0/0", + "cidr_ipv6": null, + "description": null, + "from_port": 22, + "id": "sgr-0d12aad10c53974a3", + "ip_protocol": "tcp", + "prefix_list_id": null, + "referenced_security_group_id": null, + "region": "us-west-2", + "security_group_id": "sg-0a2386ce249a576a1", + "security_group_rule_id": "sgr-0d12aad10c53974a3", + "tags": null, + "tags_all": {}, + "to_port": 22 + }, + "sensitive_attributes": [], + "identity_schema_version": 0, + "identity": { + "account_id": "822923364368", + "id": "sgr-0d12aad10c53974a3", + "region": "us-west-2" + }, + "dependencies": [ + "aws_default_vpc.default", + "aws_security_group.my_security_group" + ] + } + ] + } + ], + "check_results": null +} diff --git a/2026/day-68/terraform/variables.tf b/2026/day-68/terraform/variables.tf new file mode 100644 index 0000000000..d5a0cddd69 --- /dev/null +++ b/2026/day-68/terraform/variables.tf @@ -0,0 +1,47 @@ +variable "aws_region" { + description = "AWS region where resources will be provisioned" + type = string + default = "us-west-2" +} + +variable "instances" { + description = "Map of instance names to AMI IDs, SSH users, and OS family" + + type = map(object({ + ami = string + user = string + os_family = string + instance_type = string + })) + + # default value for instances + default = { + + "control-node" = { + ami = "ami-0d76b909de1a0595d" # Ubuntu Server 24.04 LTS + user = "ubuntu" + os_family = "ubuntu" + instance_type = "t3.micro" + } + + "web-server" = { + ami = "ami-043ab4148b7bb33e9" # Amazon Linux + user = "ec2-user" + os_family = "amazon" + instance_type = "t3.micro" + } + + "app-server" = { + ami = "ami-04c7815cd1d6c8fa4" # RHEL 9 + user = "ec2-user" + os_family = "redhat" + instance_type = "t3.micro" + } + "db-server" = { + ami = "ami-04c7815cd1d6c8fa4" # RHEL 9 + user = "ec2-user" + os_family = "redhat" + instance_type = "t3.micro" + } + } +} diff --git a/2026/day-69/2026/day-69/day-69-playbooks.md b/2026/day-69/2026/day-69/day-69-playbooks.md new file mode 100644 index 0000000000..3a25f2f2f8 --- /dev/null +++ b/2026/day-69/2026/day-69/day-69-playbooks.md @@ -0,0 +1,65 @@ +### Day 69 -- Ansible Playbooks and Modules +#### Challenge Tasks +##### Task 1: Your First Playbook + +Create install-nginx.yml: +image + +(Use apt instead of yum if your instances run Ubuntu) + +ansible-playbook -i ../inventory.ini install-nginx.yml + +image + +Verify: Curl the web server's public IP. Do you see your custom page + +image +
    + +#### Task 2: Understand the Playbook Structure +Open your playbook and annotate each part in your notes: +--- # YAML document start +- name: Play name # PLAY -- targets a group of hosts + hosts: web # Which inventory group to run on + become: true # Run tasks as root (sudo) + tasks: # List of TASKS in this play + +Answer: + +What is the difference between a play and a task? + +A play define: + +Which hosts to target +What roles/tasks to apply +A task define + +Single unit of work +Calls one module (like apt, copy, service) +It’s a high-level mapping between hosts and work +Can you have multiple plays in one playbook? + +Yes, Each play: Targets different host groups and Runs independently in sequence +What does become: true do at the play level vs the task level? + +play level Applies to ALL tasks in the play + +task level Applies only to that task + +What happens if a task fails -- do remaining tasks still run? + +Default behavior: +Execution stops for that host + +tasks: + - name: Task 1 (fails) + - name: Task 2 (won’t run) + +
    +### Task 3: Learn the Essential Modules +Practice each of these modules by writing a playbook called essential-modules.yml with multiple tasks: +image +image + + + diff --git a/2026/day-87/day-87-agentic-ai-intro.md b/2026/day-87/day-87-agentic-ai-intro.md new file mode 100644 index 0000000000..f383733528 --- /dev/null +++ b/2026/day-87/day-87-agentic-ai-intro.md @@ -0,0 +1,37 @@ +## Day 87 -- Introduction to Agentic AI for DevOps + +#### Task 1: Understand Agentic AI for DevOps +What is an AI agent? +An AI agent is a system that can perceive its environment, make decisions, and take actions to achieve a goal—often with some level of autonomy. +An AI agent = Perception + Decision-making + Action + +1. What is an AI agent? + - AI agents are autonomous software programs that use large language models (LLMs) to perceive their environment, interact with real time system. + - Unlike a chatbot that only generates text, an agent can run commands, read files, call APIs + - The LLM decides which tool to use, with what arguments, based on the user's question +2. Why agents for DevOps? + Agents for DevOps (Agentic DevOps) are autonomous software systems that use AI to reason, plan, and act, transforming DevOps from passive, manual tasks to proactive, automated operations. They are used to reduce manual toil, speed up incident response, optimize cloud costs, and enhance CI/CD pipelines, acting as intelligent +Key Reasons for Using Agents in DevOps: +- Reduced Human Error: +- Improved Efficiency and Speed +- Cost Reduction & Resource Optimization +- Proactive Problem Prevention +- Contect Intelligence + +3. The ReAct pattern (Reason + Act): + + Key Components of ReAct: + - Thought: The agent reasons about the current state, identifies what it needs to know, and plans the next step. + - Action (Act): The agent calls an external tool (e.g., web search, database API, calculator). + - Observation: The agent receives the output from the tool and evaluates the new information. + 4. Key components: + + LLM -- the brain (Ollama/Gemma 4 locally, or Claude/GPT for production) + Tools -- Python functions that wrap CLI commands (the hands) + Agent framework -- user LangChain's & Langgraph create_react_agent orchestrates the reasoning loop + MCP (Model Context Protocol) -- a standard for exposing tools to any AI client + +### Task 2: Set Up the Environment +Clone the reference repository: + +