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.

Provision a basic site

Provision a basic site - Packer Tutorial

From the course: Learning HashiCorp Packer

Start my 1-month free trial

Provision a basic site

- Using the shell provisioner, we're going to make an image that has nginex and a simple website baked in. So, we will add here an extra provisioner, for uploading the files. The provisioners are run in order, so if we add the file upload first, that means that we'll upload those before we do anything else. And we currently have a shell type provisioner, and what we're adding now is going to be a file type provisioner, so we need to specify that type. So we'll type in here, "type" and "file," and a file provisioner has two extra properties. Those properties are the source, and the destination. The source is where to find the files on my local machine, or where Packer is running, and destination is where to send those files on the machine that Packer has launched, so the source of these files is right here, which is a relative location, so we'll just add that in now. Source..files, slash website. And the destination will upload them into our home directory into a new folder called…

Contents