Skip to content

anugurthi/python-for-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python for DevOps — 14-Days Schedule

Welcome! This 14-day guide will help you learn Python for DevOps. You'll go from writing simple scripts to automating cloud tasks.

Goal: By the end, you will be able to use Python to automate tasks, build pipelines, and manage cloud resources.

Why Python for DevOps?

  • Easy to Learn: Python is readable and great for beginners.
  • Powerful: It connects easily with tools like AWS, Jenkins, and GitHub.
  • Popular: Most DevOps tools support Python.

Getting Started

  1. Start at Day 1: Go to the Day-01/ folder and follow the README.md instructions to set up your computer.
  2. One Day at a Time: Work through one folder each day.
  3. Practice: Type out the code examples yourself.
  4. Ask Questions: If you get stuck, search online or ask a community.

What You Need

  • Computer: Mac, Windows, or Linux.
  • Internet: To download tools and read documentation.
  • Time: About 1 hour per day.

Week 1 — Python Foundations for Automation

Day Theme Repo Guide Outcomes
1 Environment bootstrap Day-01/ Install Python, configure editor, run first script, document goals.
2 Data types & strings Day-02/ Work with core types, string formatting, regex for log parsing.
3 Variables & configuration Day-03/ Manage scope, constants, and configuration patterns.
4 Functions & modularity Day-04/ Build reusable helpers, packages, and testable modules.
5 Command-line interfaces Day-05/ Handle env vars, CLI arguments, and .env secrets.
6 Files, logging, and operators Day-06/ Read/write configs, log events, apply Python operators.
7 Conditional logic Day-07/ Build guard clauses, deployment gates, and decision trees.

Week 2 — DevOps Automation Projects

Day Theme Repo Guide Outcomes
8 Collections & data structures Day-08/ Model inventories with lists, tuples, dictionaries, and sets.
9 Loops & iteration patterns Day-09/ Master for/while loops, loop controls, and pagination patterns.
10 HTTP, REST, and auth basics Day-10/ Explore requests, API tokens, pagination, JSON parsing.
11 Automate GitHub repository creation Day-11/ Use GitHub REST API to create repos, manage descriptions, and initialize files.
12 Manage Jenkins jobs via API Day-12/ Authenticate with Jenkins, create/update jobs from Python, trigger builds.
13 Provision SonarQube projects Day-13/ Call SonarQube APIs to create projects, generate tokens, configure quality profiles.
14 AWS inventory & tag auditing Day-14/ Use boto3 to inventory resources and enforce tagging standards.

🎯 Capstone idea (optional): Stitch together the GitHub, Jenkins, SonarQube, and AWS scripts into a single onboarding pipeline once you finish Day 14.

Hands-On Assets at a Glance

  • Day-11/examples/create_github_repo.py — Create and configure a GitHub repository via REST API.
  • Day-12/examples/jenkins_job_provisioner.py — Define or update Jenkins jobs with XML payloads using Python.
  • Day-13/examples/sonarqube_project_setup.py — Register SonarQube projects and provision tokens for CI.
  • Day-14/examples/aws_tag_audit.py — Enumerate AWS resources filtered by tag key/value pairs.
  • simple-python-app/app.py — Lightweight Flask app for CI/CD experiments.

Study Tips for Beginners

  • Tinker daily. Adjust arguments, change payloads, and observe API responses to deepen understanding.
  • Secure secrets. Use .env files or secret managers; never commit tokens. Later days include helpers for this.
  • Automate validation. Pair scripts with smoke tests—e.g., call the GitHub API to verify repo creation succeeded.
  • Reflect often. Set a daily 5-minute retrospective to note what clicked and what needs review.

Going Further

  • Extend the AWS scripts to remediate resources missing required tags.
  • Add Slack or Teams notifications around Jenkins job creation.
  • Containerize the tooling and wire it into a self-service developer portal.
  • Share progress on LinkedIn or internal wikis to gather feedback and stay accountable.

Happy automating! 🚀

About

Python in DevOps Mindset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages