This is good stuff... I also just wanted to give people the option to 
include the chef run or not... so they could still build either a debian or 
ubuntu box... but if they don't like / want to run chef they could keep 
that completely out of the build process. Maybe also give them the option 
to substitute the chef run with an ansible play book, or a puppet run.. .etc

On Friday, October 19, 2018 at 5:47:08 AM UTC-4, Alvaro Miranda Aguilera 
wrote:
>
> 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.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/43d0e4a6-5734-46c4-a1f6-4904b89f5e56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to