Update of packer-vagrant project using HCL
Posted on May 13, 2021 by Adrian Wyssmann ‐ 2 min read
Since I last used packer it's been a while and when I recently wanted to create a new Windows vm, I used my project. This is where I realized certain things have changed with packer since I started the project.
Since I last looked at packer, Hashicorp introduced HCL Configuration Language. The new format is different, although they also support a .json
format. But I decided the new format. So first, I start to convert my existing files:
The most notable difference is the declaration and usage of variables. They are now declared in a variable block:
Variable definitions on the other hand are stored in .pkrvars.hcl
or .auto.pkrvars.hcl
- latter is loaded automatically. It is used as before:
The content consists only of variable name assignments:
The conversions of my variable files from json to the hcl-format, I had to do manually, which was some work. That’s it, you can check my [my packer-vagrant project] for the detailed changes made.
Beside of that I also updated some of the iso configurations, and removed some outdated ones. I made a quick test and the conversion of the file seems fine but there seems other issues with the ubuntu images and virtualbox: When I boot the live image for ubuntu server 20.04
or 21.04
I get a kernel panic
I have to further investigate what’s exactly happening and if this also happens to other Linux distributions.