This is a PowerShell module for writing packer configs as a PowerShell DSL. Similar To Pester, PSGraph, PSake, etc.
Writing JSON is kind of the pits. It's picky, and you're prone to doing it wrong very easily. This module makes it more "PowerShell-y" to generate packer configurations.
Simple example:
#PowerShell provisioner
Provisioner {
elevated_pasword = 'SomeBigLongPassword!'
elevated_user = 'shortround'
environment_vars = @('eeny','meenie','meine','mo')
scripts = @('./build/promote.ps1','./test/validation.ps1')
type = 'powershell'
}
The above will output the following Packer json:
{
"elevated_pasword": "SomeBigLongPassword!",
"elevated_user": "shortround",
"environment_vars": [
"eeny",
"meenie",
"meine",
"mo"
],
"scripts": [
"./build/promote.ps1",
"./test/validation.ps1"
],
"type": "powershell"
}
git clone https://github.com/steviecoaster/Packer.git
cd Packer
./build.ps1
Import-Module Packer.psd1