Hello HCP Community,
I’m new and not new to the the HCP suite of tools. Usually hit or miss on the org I’m with and what tooling is being used. Recently I was given a task to create a Windows Server 2022 image for AWS usage.
I decided pick up some HCP Packer knowledge and build a base AMI for learning purposes and building myself some baseline images.
I was able to get the AMI created and got everything working smoothly with some minor tweaks.
My only question from the docs: Build a Windows image | Packer | HashiCorp Developer
Is there a way I can pass .pkrvars.hcl variables into the bootstrap file for the Administrator account? I would like to push the bootstrap file to git for version control so the team can have this. I was seeing to use the Go templating syntax i.e. {{ .admin_secret }} but had no luck. I even doulbe quoted the value and still wasn’t able to get the credential to work in the bootstrap file.
It wasn’t until I hard-coded the value that it resolved my issues so I thought I wasn’t passing the credential correctly. Any suggestions are appreciated.