MageSmith

Magento 2 Ansible Generator

Generate a production-ready Ansible playbook that provisions an Ubuntu 24.04 server for Magento 2.

Magento 2 Ansible Generator screenshot

What Magento 2 Ansible Generator does

  • Magento-version-driven stack matrix — pick 2.4.9 and PHP 8.5, MariaDB 11.8, OpenSearch 3.3, Valkey 9.0, Varnish 8.0, RabbitMQ 4.2 snap into place
  • Service toggles for Valkey, OpenSearch, Varnish, RabbitMQ, Let's Encrypt SSL, Postfix relay, daily backup cron — pay only the install time for what you actually need
  • Idempotent Ansible roles for Ubuntu 24.04 LTS — re-run any role with --tags to apply config changes without rebuilding the box
  • Vault-encrypted secrets workflow — bundle ships a vault.yml.example template; you fill in passwords and ansible-vault encrypt before checkin
  • Sane defaults for production: UFW firewall, fail2ban, OPcache tuned, MariaDB InnoDB tuned, Varnish VCL with Magento tag-based BAN
  • Re-runnable per service — bash one-liner regenerates the bundle when you tweak the form

How it works

1

Describe the server

Hostname, IPv4, primary domain, deploy username — plus which Magento version you're targeting. Defaults snap to Adobe's tested matrix for that minor.

2

Toggle the stack

Check Valkey for cache, OpenSearch for search, Varnish for full-page cache, RabbitMQ for async queues. Each toggle adds (or removes) a single Ansible role from the bundle.

3

Download + run

Unzip on your control machine, fill secrets in vault.yml, ansible-vault encrypt, then ansible-playbook playbooks/site.yml. ~10 minutes on a 4 vCPU droplet.

Frequently asked about Magento 2 Ansible Generator

What OS does the generated playbook target? +

Ubuntu 24.04 LTS only in v1. Multi-distro support (Ubuntu 22.04, Debian) is on the roadmap if there's demand.

Does it install Magento itself? +

No — v1 stops at server provisioning. After it runs, you have a server ready to host Magento (Nginx vhost waiting, PHP-FPM pool live, DB created). You drop your codebase + DB dump on top. Automating that step is v2.

How are secrets handled? +

The bundle ships a vault.yml.example with CHANGE_ME placeholders. You replace them with real values, then run ansible-vault encrypt. The vault password lives in ~/.vault_pass on your control machine — never committed.

Can I use Adobe Commerce instead of Open Source? +

Yes — the playbook only provisions infrastructure. Composer auth (auth.json with repo.magento.com keys) is something you set up at deploy time, after this playbook runs.

What if I want OpenSearch off and use the built-in MySQL fulltext search? +

Untoggle OpenSearch — the role is removed from the bundle and Magento defaults to MySQL search. Note that Adobe officially requires OpenSearch on 2.4.7+.

Will it work on AWS / DigitalOcean / Hetzner? +

Anywhere you can SSH into a fresh Ubuntu 24.04 server as root. Tested on DigitalOcean droplets and Hetzner CX22 instances. AWS EC2 needs the same setup but typically uses ubuntu user instead of root for the first connect — adjust the initial -u flag accordingly.

Related tools

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.