Lampsible – short for LAMP stacks with Ansible – leverages the power of Ansible, and wraps it up into a simple CLI application that you can use to automate the deployment of a classic infrastructure setup, the LAMP stack: Linux, Apache, MySQL, PHP, to be exact.
Real life examples: Got an Ubuntu VPS and want a fresh, production-ready WordPress site, with valid SSL certificate, custom wp-admin credentials and other configs? Lampsible does this all in one command. How about a virtual machine in your local network, and you need an Apache webserver with customized virtual hosts and set of PHP extensions? Again, Lampsible sets it all up with one CLI command.
td;dr: https://github.com/saint-hilaire/lampsible
Here’s what it looks like:
Like Ansible, the powerful automation framework that it uses under the hood, Lampsible is written in Python, and can be installed with Pip:
python3 -m pip install lampsible
Of course, you can also download the code and build from source, and if you’re into that, you’ll likely want to do it in a virtual environment as well:
git clone https://github.com/saint-hilaire/lampsible
cd lampsible
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install .
After that, the rest is quite simple. For example, to install a production-ready WordPress site, all you have to is:
lampsible youruser@yourhost.com wordpress \
--ssl-certbot --email-for-ssl you@yourdomain.com
All the important stuff that you omit, you’ll be prompted for, or offered a default value. Of course, you can also pass in things like --wordpress-site-title
or --wordpress-admin-email
, or even fancier things like --php-version
, --wordpress-version
, --php-extensions
, --test-cert
, or a bunch of other stuff. Just run the --help
flag to see all the currently supported features (current version at time of writing: 1.0)
A more advanced feature might be installing Apache and PHP on a virtual machine in your local network, and passing in some more fine tuned Apache virtual host configurations, and a custom set of PHP extensions that you require. That might look like this:
lampsible someuser@192.168.123.123 lamp-stack \
--ask-remote-sudo \
--ssl-selfsigned \
--database-username dbuser \
--database-name testdb \
--php-version 8.1 \
--apache-vhost-name some-legacy-app \
--apache-document-root /var/www/html/some-legacy-app/some-dir/public \
--php-extensions mysql,xml,mbstring,xdebug,gd
I’m well aware that “professional” web services these days all run in containers on Kubernetes, and I fully understand why, though I know that it’s not without its drawbacks. In the end, however, Lampsible is intended to be an homage to the old-school. As such, some features I might implement in the future include the automated deployment of other old school classics, such as Drupal, Joomla, Zend apps, and so on. Of course, if you want to help me implement these things, please feel free to reach out! 😉