I've been trying to figure out the possibility of using option vars in packer, my script is as follows:
"provisioners": [{
"type": "shell",
"scripts": [
"scripts/centos/5.11/puppet-{{user `config`}}.sh",
]
}],
"variables": {
"config": "{{user `type`}} | slave",
}
Were a typical command would be:
packer build \
-var 'config=master' \
template.json
But also be able to just do the following:
packer build template.json # were config would default to slave