I’m working on something that involves a lot of similar-source packer templates that each have specific and unique build-time provisioners. To assist with this, I want to create some root directory configuration files and have sub-directory configurations use and expand these items, however, I’m running into a lot of issues with undefined values.
Here’s a generic example of the file structure im trying to use:
| inputs.auto.pkrvars.hcl | source.auto.pkr.hcl | vars.auto.pkr.hcl | some-template/ | - template.pkr.hcl | - provision.sh | another-template/ | - template.pkr.hcl | - provision.sh
packer build from the root directory, but every time it seems to fail to find the auto packer files ive defined, and errors out before moving further due to variables I’m passing via
packer build not being defined. I know those files are configured properly, as when they’re placed in one of my sub-directories, the build works without issue. Running with
PACKER_LOG=1 provides no information on what files are being sourced and such.
Is this a valid way of setting up a build structure? I would highly prefer not doing all of this in one directory, as I have a large number of different template files that, for clarity and readability, I would like to keep separated with their own dependencies. If this isn’t, is there anything else I can do to minimize duplication across the sub-directories?
Thank you for your time and any assistance you can provide