Hello
you can put into variables all the info for ubuntu into
ubuntu.json
and all the debian into
debian.json
then use
packer build -var-file ubuntu.json template.json
if you need to use this on the provisioner, say you got different chef playbooks, you could use then
{
"variables": {
"build_name": "",
..
},
},
"builders": [
{
"name": "{{ user `build_name` }}",
..
"type": "virtualbox-iso"
}
],
"provisioners": [
{
"only": "ubuntu"
...
}
],
"provisioners": [
{
"only": "debian"
..
}
]
}
just add a variable to each json and the template for build_name
hope this helps.
alvaro.