Skip to content

Ansible & Vagrant lab demonstrating infrastructure automation. Features multi-server environment with PostgreSQL DB and Python app, validated by GitHub Actions CI. SRE/DevOps learning project.

License

Notifications You must be signed in to change notification settings

DanLinX2004X/ansible-lab

Repository files navigation

ansible-lab

CI Ansible YAML Ruby

🇷🇺 Russian Version


Project Overview

ansible-lab is a pet project to practice Ansible and Vagrant. It provisions a simple environment with:

  • DB VM: PostgreSQL database server
  • App VM: Simple application environment with Python script for DB connectivity check and static HTML page

This project demonstrates practical Ansible skills for SRE/DevOps interviews, focusing on infrastructure automation and configuration management.

Note: The project does not use the outdated vagrant-vbguest plugin due to Ruby compatibility issues. Provisioning is handled fully via Vagrant and Ansible.


Project Structure

ansible-lab/
├── ansible.cfg
├── .gitattributes
├── .gitignore
├── .github/workflows/pipeline.yml
├── inventory.yml
├── ping.yml
├── playbook.yml
├── README.md
├── roles/
│   ├── app/
│   │   ├── files/index.html
│   │   ├── tasks/main.yml
│   │   └── templates/check_db.py.j2
│   └── db/
│       └── tasks/main.yml
├── .vagrant/
│   ├── machines/
│   │   ├── app/virtualbox/vagrant_cwd
│   │   └── db/virtualbox/vagrant_cwd
│   └── rgloader/loader.rb
└── Vagrantfile

Features

  • Ansible Automation: Multi-server provisioning using roles and playbooks
  • Vagrant Infrastructure: VM management with private networking
  • CI/CD Integration: GitHub Actions for syntax validation
  • Configuration Management: YAML-based infrastructure as code

Usage

  1. Clone the repository:

    git clone https://github.com/DanLinX2004X/ansible-lab.git
    cd ansible-lab
  2. Start Vagrant VMs:

    vagrant up
  3. Check Ansible syntax (CI also covers this):

    ansible-playbook --syntax-check playbook.yml
  4. Verify connectivity:

    ansible all -i inventory.yml -m ping

CI / GitHub Actions

Pipeline triggers on push and pull_request events:

  • Ansible playbook syntax check
  • Vagrantfile Ruby syntax check
  • YAML validation (warnings don't fail pipeline)

Skills Demonstrated

  • Ansible: Playbooks, roles, inventory management
  • Vagrant: Multi-VM environments, networking
  • YAML: Configuration as code
  • CI/CD: Automated testing with GitHub Actions
  • Infrastructure Automation: End-to-end provisioning

Author

DanLinX2004X

License

MIT License - LICENSE check for details

About

Ansible & Vagrant lab demonstrating infrastructure automation. Features multi-server environment with PostgreSQL DB and Python app, validated by GitHub Actions CI. SRE/DevOps learning project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published