Examples of powershell over SSH?

53 views
Skip to first unread message

goffries

unread,
Feb 26, 2019, 12:40:18 PM2/26/19
to Packer
Anyone have any practical examples of running the powershell provisioner over SSH using the azure builder?

Megan Marsh

unread,
Feb 26, 2019, 12:41:36 PM2/26/19
to packe...@googlegroups.com
I think you may find the examples in this repo helpful: https://github.com/joefitzgerald/packer-windows

On Tue, Feb 26, 2019 at 9:40 AM goffries <goff...@gmail.com> wrote:
Anyone have any practical examples of running the powershell provisioner over SSH using the azure builder?

--
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/3272c1c1-dd4f-4084-9c3e-07c257439097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

goffries

unread,
Feb 26, 2019, 4:44:37 PM2/26/19
to Packer
Thanks!

Is there an equivalent of {{.WinRMPassword}} for SSH?

Megan Marsh

unread,
Feb 26, 2019, 4:53:36 PM2/26/19
to packe...@googlegroups.com
Unfortunately, no.

Kiran

unread,
Jun 26, 2020, 7:15:03 AM6/26/20
to Packer
Hello Megan,

Just curious. Is it possible to create Windows VM's in Azure using ssh communicator?  Or is Winrm the only choice?

Regards,
Kiran Hegde

On Wednesday, February 27, 2019 at 3:23:36 AM UTC+5:30, Megan Marsh wrote:
Unfortunately, no.

Megan Marsh

unread,
Jun 26, 2020, 12:25:35 PM6/26/20
to packe...@googlegroups.com
I don't have any examples in my pile of configs. I believe the issue you'll run into is that the windows vms on Azure don't have cloud-init, so it's not possible to directly run scripts to install the ssh server on your windows vm without first connecting via winrm which is set up by default. My suggestion would be to use winrm to connect to a vm, run the scripts necessary to set up the ssh daemon, save off that base image, and then have a main build that performs the following ssh connections. Alternatively, you could create windows vm from iso and install ssh using an autounattend script, then save that vm and import it to Azure. In either case, you'll need to check your Azure networking rules to make sure that the necessary ports and traffic types are allowed.

Kiran

unread,
Jun 27, 2020, 2:23:28 AM6/27/20
to Packer
Hello Megan

Thank you very much Much appreciated.

Regards,
Kiran Hegde
Reply all
Reply to author
Forward
0 new messages