VLW development environment provisioning with Ansible
  • Shell 41.9%
  • Python 27.8%
  • Jinja 20.9%
  • PHP 3.7%
  • Makefile 3.5%
  • Other 2.2%
Find a file
2026-11-01 12:23:55 +01:00
ansible refactor(ansible): streamline build structure (#11) 2026-11-01 12:23:55 +01:00
docs feat: add Ansible provisioner (#8) 2026-11-01 09:30:09 +01:00
scripts refactor(ansible): streamline build structure (#11) 2026-11-01 12:23:55 +01:00
.gitignore feat: add Ansible provisioner (#8) 2026-11-01 09:30:09 +01:00
Makefile refactor(ansible): streamline build structure (#11) 2026-11-01 12:23:55 +01:00
README.md refactor(ansible): streamline build structure (#11) 2026-11-01 12:23:55 +01:00

Ansible

Development environment provisioning

Ansible service

This repository is an Ansible-based provisioning service for building and maintaining the VLW Debian development environment. Make and the scripts under scripts/ provide the user-facing commands, while the playbooks and roles under ansible/ define and apply the desired system state. It runs on demand and is not a continuously running background service. The system and web-stack installer is intentionally separate from the universal dotfiles repository.

Install

On a fresh Debian 12 or Debian 13 amd64 host, clone this repository and run:

./ansible/bootstrap.sh
make install all
make verify

The bootstrap command installs the minimal system prerequisites and a pinned Ansible runtime. make install without an argument provides interactive component selection. Individual components can also be installed directly:

make install packages
make install php-fpm
make install mariadb
make install webserver
make install vegvisir
make install reflect
make install phpmyadmin
make install phpliteadmin

Use check and diff after a component to pass Ansible's corresponding read-only flags, for example make install packages check diff.

Installer output includes a timestamp when every Ansible task starts, a heartbeat every ten seconds while a task is running, and captured subprocess output when the task finishes. Set DEV_INSTALL_HEARTBEAT_SECONDS to another number of seconds, or to 0 to disable heartbeats. Output from tasks protected with Ansible's no_log remains hidden.

Repository layout

  • ansible/ contains the inventory, playbooks, roles, service configuration, bootstrap entry point, and verification playbook.
  • scripts/install.sh provides interactive and component-based installation.
  • scripts/lib.sh contains the shell helpers shared by the entry points.
  • docs/ contains repository documentation assets.

The Ansible role files and templates are the only source of truth for managed service configuration. The repository does not keep separate rendered nginx or phpMyAdmin reference copies that can drift from the deployed state.

Runtime dependencies are stored outside the checkout under ~/.local/state/dev and ~/.local/share/dev; no path in the installer points back to the dotfiles repository.

Framework example

Vegvisir and Reflect intentionally track their latest stable semantic release tags rather than pinned commits. Each installation queries git.vlw.se and checks out the selected tag directly in /var/www/fw/vegvisir or /var/www/fw/reflect, changing the checked-out Git version when a newer stable release is available.

The framework roles create a shared example project at /var/www/sites/example:

  • Vegvisir serves a small installation-confirmation website on port 44301.
  • Reflect reads endpoints from /var/www/sites/example/api and serves a public GET /ping on port 44302, returning plaintext Pong.

Reflect receives a host-generated database password stored with mode 0600 at ~/.local/state/dev/reflect-database-password. The password is not committed or printed by Ansible.

phpMyAdmin

The phpMyAdmin component is available at https://localhost:44300/tools/pma/ immediately after installation. It logs in as the local www-data operating-system user through MariaDB's UNIX socket and has the same global ALL PRIVILEGES grant as the reference environment. No database password is stored in the repository.

This configuration intentionally gives processes running as www-data full control of the local MariaDB server. Port 44300 must therefore only be exposed to trusted clients.

phpLiteAdmin

The phpLiteAdmin component installs the same pinned development build used by the reference environment and exposes it at https://localhost:44300/tools/pla/. SQLite databases placed in /var/www/tools/pla-db appear in the interface and remain in place when the phpLiteAdmin release is reinstalled or changed.

The reference environment disables phpLiteAdmin's application password, and the provisioned configuration intentionally does the same. The interface can read, modify, create, and delete databases in its managed directory, so port 44300 must only be exposed to trusted clients.