From the course: Learning HashiCorp Packer

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Simplify provisioning with a config tool

Simplify provisioning with a config tool - Packer Tutorial

From the course: Learning HashiCorp Packer

Start my 1-month free trial

Simplify provisioning with a config tool

- [Instructor] Using the shell provision quickly gets complicated. Moving the script from inline to file can help, but it will still grow into something very complex to maintain. So another approach is to use a configuration management tool, such as Ansible or Chef, to customize the image. You may already have these tools in use within your organization, which is perfect because then we can tell Packer to use your existing script. As we did with the shell provisioner, we're going to use Ansible to provision our instance, and we'll start with a simple hello world example. So we'll write a very simple Ansible script that simply prints out a debug message of hello world. Let's create a new yml file called helloworld dot yml. So I'll make a new file here, helloworld dot Y-M-L. And we'll give it the name of echo, so I'm gonna make a very, very simple Ansible script here. I'm not gonna go into too much detail about what Ansible is or how it works. It's a conflict management tool. It will…

Contents