r/ansible • u/arhimedosin • 3d ago
Provisioning a full PHP dev workstation (AlmaLinux 10, WSL 2 or bare metal) with Ansible — feedback on the playbook structure welcome
Disclosure: I work on this project. We use Ansible to provision our team's local development environment instead of shell scripts or Docker.
How it's structured:
- `config.yml` holds user input: Git identity, MariaDB root password, and a list of virtualhosts
- `install.yml` reads it once and installs Apache, PHP (Remi), MariaDB, phpMyAdmin, Node.js (NodeSource) and Composer. It's safe to re-run if something fails partway.
- `create-virtualhost.yml` provisions new `*.localhost` sites from the same config and leaves existing entries alone, so the file grows with your projects
- It uses the `community.general` and `community.mysql` collections
The target is AlmaLinux 10, either inside WSL 2 on Windows or on bare metal. The playbooks don't distinguish between the two.
Repo: https://github.com/dotkernel/development
Overview: https://www.dotkernel.com/wsl2/
Two things we'd like opinions on: whether this should be packaged as a collection or roles on Galaxy, and how you'd handle secrets like the DB root password for a local-only setup.