Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows over WinSSH with ansible provisioner #172

Open
magustin-telus opened this issue Jun 16, 2023 · 2 comments
Open

Windows over WinSSH with ansible provisioner #172

magustin-telus opened this issue Jun 16, 2023 · 2 comments
Labels

Comments

@magustin-telus
Copy link

magustin-telus commented Jun 16, 2023

Overview of the Issue

sysprep commands from documentation to enable SSH not working.

Reproduction Steps

followed the documentation from https://developer.hashicorp.com/packer/plugins/builders/googlecompute#windows-over-winssh-ansible-provisioner

using GCP windows image windows-server-2019-dc-v20230510

Plugin and Packer version

packer version 1.9.1

Simplified Packer Buildfile

buildfile is the same as the documentation

2023/06/16 19:43:45 GCEMetadataScripts: sysprep-specialize-script-cmd: The user or group account specified cannot be found.
2023/06/16 19:43:45 GCEMetadataScripts: sysprep-specialize-script-cmd: The user was successfully created but could not be added
2023/06/16 19:43:45 GCEMetadataScripts: sysprep-specialize-script-cmd: to the USERS local group.

2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd: New-NetFirewallRule : Cannot create a file when that file already exists.
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd: At line:1 char:1
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd: + New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenS ...
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd:     + CategoryInfo          : ResourceExists: (MSFT_NetFirewallRule:root/st
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd:    andardcimv2/MSFT_NetFirewallRule) [New-NetFirewallRule], CimException
2023/06/16 19:47:45 GCEMetadataScripts: sysprep-specialize-script-cmd:     + FullyQualifiedErrorId : Windows System Error 183,New-NetFirewallRule
@lmayorga1980
Copy link
Contributor

Currently, i am experiencing the same issue with packer 1.9.4 and image windows-server-2019-dc-v20231115

@smartyr73
Copy link

The latest Google Windows base images come with openSSH by default. Just need to enable at runtime.

https://cloud.google.com/compute/docs/connect/windows-ssh

Just include this in the Packer template file:

metadata = {
“sysprep-specialize-script-cmd” = “googet -noconfirm=true update && googet -noconfirm=true install google-compute-engine-ssh"
"enable-windows-ssh" = "TRUE"
}

Set SSH communicators as normal

https://developer.hashicorp.com/packer/docs/communicators/ssh

Bear in mind it's still in preview though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants