官术网_书友最值得收藏!

  • Learning DevOps
  • Mikael Krief
  • 388字
  • 2021-06-24 12:32:14

Optimizing Infrastructure Deployment with Packer

In the previous chapters, we learned how to provision a cloud infrastructure using Terraform and then we continued with the automated configuration of VMs with Ansible. This automation allows us to benefit from a real improvement in productivity and very visible time-saving.

However, despite this automation, we notice the following:

  • Configuring a VM can be very time-consuming because it depends on its hardening as well as the middleware that will be installed and configured on this VM.
  • Between each environment or application, the middleware versions are not identical because their automation script is not necessarily identical or maintained over time. Hence, for example, the production environment, being more critical, will be more likely to have the latest version of packages, which is not the case in ante production environments. And with this situation, we often encounter issues with the behavior of applications in production.
  • Configuration and security compliance is not often applied or updated.

To address these issues, all cloud providers have integrated a service that allows them to create or generate custom VM images. These images contain all of the configurations of the VMs with their security administration and middleware configurations and can then be used as a basis to create VMs for applications.

The benefits of using these images are as follows:

  • The provisioning of a VM from an image is very fast.
  • Each VM is uniform in configuration and, above all, is safety compliant.

Among the Infrastructure as Code (IaC) tools, there is Packer from the HashiCorp tools, which allows us to create VM images from a file (or template).

In this chapter, we will learn how to install Packer in different modes. We will discuss the syntax of Packer templates to create custom VM images in Azure that use scripts or Ansible playbooks.

We will detail the execution of Packer with these templates. Finally, we will see how Terraform uses the images created by Packer. Through this chapter, we'll understand that Packer is a simple tool that simplifies the creation of VMs in a DevOps process and integrates very well with Terraform.

In this chapter, we will cover the following:

  • An overview of Packer
  • Creating Packer templates using scripts
  • Creating Packer templates using Ansible
  • Executing Packer
  • Using images created by Packer with Terraform
主站蜘蛛池模板: 山西省| 泸州市| 乳山市| 法库县| 南雄市| 萨迦县| 绥江县| 武穴市| 德保县| 余江县| 班玛县| 石门县| 长武县| 蕲春县| 黄大仙区| 九龙县| 禹州市| 莱阳市| 合作市| 四平市| 蓝山县| 弋阳县| 山东| 襄汾县| 都昌县| 星子县| 加查县| 金阳县| 本溪市| 兴安县| 泽州县| 新蔡县| 华安县| 哈巴河县| 淮阳县| 平武县| 逊克县| 开封县| 都兰县| 金坛市| 阿城市|