Digital Ocean has continued their series about deploying "advanced PHP applications" on an Ubuntu instance via Ansible in part two of the series. If you missed the first part of the series, you can check it out here.
This tutorial is the second in a series about deploying PHP applications using Ansible on Ubuntu 14.04. The first tutorial covers the basic steps for deploying an application, and is a starting point for the steps outlined in this tutorial.
In this tutorial we will cover setting up SSH keys to support code deployment/publishing tools, configuring the system firewall, provisioning and configuring the database (including the password!), and setting up task schedulers (crons) and queue daemons. The goal at the end of this tutorial is for you to have a fully working PHP application server with the aforementioned advanced configuration.
You'll need to finish the first tutorial if you want to follow along here. They pick up where they left off to finish the whole process, starting with a switch to a more advanced example repository. They modify the Ansible configuration and run the playbook to update the host. From there they break things down into several more steps:
- Setting up SSH Keys for Deployment
- Configuring the Firewall
- Installing the MySQL Packages
- Setting up the MySQL Database
- Configuring the PHP Application for the Database
- Migrating the Database
- Configuring cron Tasks
- Configuring the Queue Daemon
While a good bit of these steps relate to something Laravel needs (what they use for the sample application), it's still a good overview of the wide range of things you can do with Ansible during deployment.