WhatsApp

๐Ÿง Linux ยท Ansible

I Built a Fully Automated DevOps Workstation Using Ansible

Setting up a DevOps workstation manually is a trap. You install tools one by one, configure them separately, fix dependency conflicts, and three hours later you have a working environment you can't reproduce. Rebuild the machine, start over. This project replaces all of that with a single Ansible playbook that provisions a complete DevOps environment in one command.

The Problem

A typical DevOps engineer needs: Git, Docker, Terraform, Vagrant, VirtualBox, AWS CLI, Ansible, Python, kubectl, and several more tools โ€” each with its own install method, each with version dependencies, each with post-install configuration. Doing this manually on a new machine takes hours. Doing it consistently across multiple machines is nearly impossible without automation.

Solution Architecture

Host Machine (Xubuntu / Debian) โ†“ ansible-playbook setup.yml โ”œโ”€โ”€ System packages (apt) โ”œโ”€โ”€ Docker + Docker Compose โ”œโ”€โ”€ Terraform (latest via HashiCorp repo) โ”œโ”€โ”€ Vagrant + VirtualBox โ”œโ”€โ”€ AWS CLI v2 โ”œโ”€โ”€ Python dev environment โ””โ”€โ”€ Shell configuration (.bashrc, aliases) # Total time: ~8 minutes on fresh install

One Command Setup

git clone https://github.com/muhammadkamrankabeer-oss/devops-workstation-automation.git
cd devops-workstation-automation
ansible-playbook -i inventory setup.yml --ask-become-pass

That's it. The playbook handles everything โ€” adds apt repositories, imports GPG keys, installs packages in the right order, configures services, and verifies each tool is working before moving to the next.

Idempotency โ€” Run It Anywhere, Anytime

Every task in the playbook is idempotent. Run it on a fresh machine: installs everything. Run it again on the same machine: changes nothing, confirms everything is already correct. Run it six months later after a partial uninstall: repairs what's missing, leaves what's intact.

- name: Install Docker
  apt:
    name: docker-ce
    state: present          # installs if missing, skips if present

- name: Add user to docker group
  user:
    name: "{{ ansible_user }}"
    groups: docker
    append: yes             # idempotent โ€” won't duplicate

Tech Stack Installed

Lightweight Linux Optimization

The playbook runs on Xubuntu โ€” a lightweight Debian-based distro designed for older hardware. I added optimization tasks that disable unnecessary services and free up RAM for the DevOps tools that actually matter:

- name: Disable unnecessary services
  systemd:
    name: "{{ item }}"
    enabled: no
    state: stopped
  loop:
    - bluetooth
    - cups
    - ModemManager

Key Lessons

What's Next

Work With Me

Need help implementing any of this?

I offer consulting for Linux, AWS, CI/CD, Docker, Terraform, and monitoring setup. Let's talk.

Book Free Consultation WhatsApp โ†’