← all builds

From-Scratch Build · Infrastructure

Lab Provisioning Scripts

A toolkit of scripts that takes a freshly-installed machine and turns it into a fully set-up workstation — same packages, same accounts, same services, every time. Built from scratch to learn how to make machine setup repeatable instead of manual.

BashAnsibleUbuntu AutomationReproducible setup

What it is

Setting up a computer, written down as code

Configuring a new machine by hand is slow and forgettable: install these packages, create those users, enable remote desktop, point it at the right DNS, repeat. Do it a dozen times and no two machines end up quite the same. This build replaces all of that clicking and typing with scripts — the recipe for a finished workstation, captured once and run on demand.

It splits the work into clear phases. A post-install pass handles everything you do right after the OS boots — repositories, essential software, development tools. A system-management set handles the ongoing chores: adding users, configuring SSH and remote desktop, keeping directories in sync. Some steps are plain shell; the ones that benefit from being declarative are written as Ansible playbooks.

The core idea I wanted to learn: a machine's configuration is just data, and data belongs in version control. If setup is a script, it's repeatable, reviewable and recoverable — and onboarding a new computer stops being a memory test.

The stack

Tools under the hood

The point of this rebuild was the automation toolchain. Here is what each piece does and why it earned its place.

scripting

Bash

The workhorse for direct, imperative steps — adding repositories, installing tool sets, wiring up the bits that are simplest as a sequence of commands.

orchestration

Ansible

Declarative playbooks for setup that should be idempotent — configure SSH, sudoers, remote desktop. Describe the end state; let Ansible reach it.

phasing

Post-install pass

The first-run sequence: repositories, essentials, language and robotics toolchains — taking a bare OS to a working environment.

operations

System management

The ongoing chores — user accounts, host entries, directory sync — packaged so day-two admin is as scripted as day one.

networking

Local DNS & services

Scripts to enable local name resolution and stand up shared services, so machines find each other without manual config.

versioning

Tagged releases

The toolkit is versioned and tagged, so a machine can be provisioned against a known, pinned revision rather than "whatever's latest".

From bare OS to ready

The provisioning sequence

Bringing up a new machine follows the same disciplined order every time — that sameness is the whole point:

  1. Add repositories live

    Register the package sources the rest of the setup will pull from, so installs find the right versions.

  2. Install essentials live

    Lay down the base toolset — common utilities, development tools and the language runtimes the lab depends on.

  3. Configure services live

    Ansible brings SSH, sudoers and remote desktop to a known-good state, idempotently.

  4. Set up accounts & hosts live

    Create users and populate host entries so the machine slots cleanly into the network.

  5. Sync shared directories live

    Wire up directory synchronisation so shared data lands in the right place automatically.

  6. One-command bootstrap future

    A single entry script that runs every phase end-to-end unattended. Left as future work; for now phases are run deliberately.

How it's organised

A place for every script

The toolkit is laid out by what each script is for, so finding the right one is obvious:

A golden rule runs through all of it: no credentials in the repo. Configuration is public and shareable precisely because secrets never live in it.

Reflection

What building it taught me