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.
On Tuesday, January 29, 2019 at 10:40:18 AM UTC-8, Reza A wrote:
>
> 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,
>
>
--
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/bf106ca2-6172-4145-b181-39a499b0ce29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.