Immutable Infrastructure with Packer
In the previous chapter, we looked at configuration management with Ansible and the tool’s core concepts. We also discussed Terraform and IaC in Chapter 8, Infrastructure as Code (IaC) with Terraform. In this chapter, we will look at another way of provisioning your infrastructure and configuration using both tools, as well as another one, called Packer. With all three tools, let’s boot up a scalable Linux, Apache, MySQL, and PHP (LAMP) stack on Azure.
In this chapter, we’re going to cover the following main topics:
- Immutable infrastructure with HashiCorp’s Packer
- Creating the Apache and MySQL playbook
- Building the Apache and MySQL images using Packer and Ansible provisioners
- Creating the required infrastructure with Terraform