Summary
In this chapter, we have done a deep dive into using Ansible to deploy our WordPress environment in AWS.
After discussing what our deployment looks like, we walked through the Ansible playbook and expanded on the quick overview that we had in Chapter 4, Deploying to Microsoft Azure. We discussed Ansible roles and how to bootstrap one using the ansible-galaxy
init
command.
We discussed some of the built-in functions and utilities, such as ipsubnet
, sort
, and regex_replace
, which we used to manipulate hardcoded and output variables. We also covered a few different approaches for building logic into our playbook tasks using functions such as until
to make sure that our playbook does not error both when launching the resources and, just as importantly, when terminating resources. After all, we don’t want stray resources hanging around and costing money.
We then took a quick look at how we would deploy the same resources using Terraform, as we had already done a...