Builders AWS + VMWare

18 views
Skip to first unread message

Reza A

unread,
Jan 29, 2019, 1:40:18 PM1/29/19
to packe...@googlegroups.com
Hi Everyone,

I wanted to know if it's possible to have one file that can build in VMWare Workstation and AWS at the same time. I know a packer file can contain multiple builders, however there are slightly different ways to access the resources once they're up in each builder.

For example when accessing an AWS instance you call the {{ .WinRMPassword }} variable to gain access, where as in Workstation I can provide the username and password. My thoughts are to change the AWS password via UserData when the instance is called to solve for this.

However on my work station build I need to install VMWare-Tools, whereas this isn't required in AWS. I suppose I could have the script check for the environment type to make the decision if VMWare tools should be installed.

I'm new to packer so I'd love to hear some feedback from the community on how to best approach this.

Thanks,

Alvaro Miranda Aguilera

unread,
Jan 29, 2019, 1:42:41 PM1/29/19
to packe...@googlegroups.com
on providers you can filter on provider type or name (if you set one) and that will allow you install vmware-tools only on vmware provider.

an example here:

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 packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/1214995427.3309.1548346033457.JavaMail.zimbra%40lethalnetworks.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Justin DynamicD

unread,
Jan 29, 2019, 1:46:50 PM1/29/19
to Packer
So the short answer is yes:  this can be done.

The builder stanza should contain all the connection info for the target instance.Even though the WinRM module isn't specifically part of the builder, this was placed the intentionally to help drive home that different platforms may require unique creds.

During the provisioning you can set "only: ["amazon-ebs"]" or whatever builder you want in order to limit steps that are builder specific.  This can be particularly helpful as AWS and VMware have very different sysprep processes when builds are done.

Finally, when you go to execute packer, you can use the "-only" flag to restrict which builder to use if you ever need to do a "one-off" deployment.

Pietto Vasco

unread,
Jan 29, 2019, 2:00:25 PM1/29/19
to packe...@googlegroups.com
NIce, Ive been working on the same thing.

--
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 packer-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages