Reader small image

You're reading from  HashiCorp Packer in Production

Product typeBook
Published inJul 2023
PublisherPackt
ISBN-139781803246857
Edition1st Edition
Right arrow
Author (1)
John Boero
John Boero
author image
John Boero

John Boero has 20 years of experience in the tech industry covering engineering, consulting, architecture, and pre-sales. He comes from Chicago, IL in the USA but currently lives in London, UK. He has worked for Red Hat, Puppet, and HashiCorp and remains active in the open source community. All commissions for this book will be donated to the Raspberry Pi Foundation non-profit to encourage coding and computing skills for kids.
Read more about John Boero

Right arrow

Base image strategy

Maybe separation of duty means that different people have control over different cloud resources or container registries. Maybe some HCL files in a template directory should be read-only while others, such as variable declarations, may be edited. We need to build out a directory structure that accommodates collaboration and also helps us reuse common code. Remember that HCL doesn’t have an include or a require directive to import other files or modules. You can run Packer against a single HCL file or against a directory, which will result in the combination of all HCL files included. It’s not so easy to #include common.hcl from a shared read-only space. Luckily, we have the simple option of symbolic links for this, where you can alias a common template file into your template directory. Here is an example:

$ ln –s ../common/basicconfig.hcl .

If you look at the GitHub repository for this project, you’ll see that the single HCL2 file...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
HashiCorp Packer in Production
Published in: Jul 2023Publisher: PacktISBN-13: 9781803246857

Author (1)

author image
John Boero

John Boero has 20 years of experience in the tech industry covering engineering, consulting, architecture, and pre-sales. He comes from Chicago, IL in the USA but currently lives in London, UK. He has worked for Red Hat, Puppet, and HashiCorp and remains active in the open source community. All commissions for this book will be donated to the Raspberry Pi Foundation non-profit to encourage coding and computing skills for kids.
Read more about John Boero