From the course: Learning HashiCorp Packer

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Provision Hello World

Provision Hello World

- [Instructor] Provisioners customize the instance that Packer has launched from the builder section. And then it will take the image. Packer has support from multiple types of provisioners, from the simple shell command all the way up to running full config management tools, like Ansible and Chef. We'll add a really simple shell provisioner to our current template here, which just echos out Hello World. Provisioners are top-level elements at the same level as builders, so we need to put a comma in here and type in provisioners. And it's an array. You can have multiple provisioners, but we'll just have one today, just our Hello World one. And the type, we have to specify what type it is, as we said before, there could be many, many kinds. And the type here is just shell. So type is shell. And the shell can be inline or as a script. And a script is a file, so we'd have a separate file for that one. But we're just having a really simple one now, so we'll just have it as inline. So we'll…

Contents