I have a trouble with winRM connectivity, my configuration:
*{*
* "variables": {*
* "startup_script": "winrm quickconfig -quiet & net user /add packer & net
localgroup administrators packer /add & netsh advfirewall firewall set rule
name=\"Windows Remote Management (HTTP-In)\" profile=public new
remoteip=any & winrm set winrm/config/service @{AllowUnencrypted=\"true\"}
& winrm set winrm/config/service/auth @{Basic=\"true\"} & powershell.exe
-NoProfile -ExecutionPolicy Bypass -Command \"Set-ExecutionPolicy
-ExecutionPolicy bypass -Force\""*
* },*
* "builders": [{*
* "type": "googlecompute",*
* "account_file": "acc.json",*
* "project_id": "test-project",*
* "source_image": "windows-server-2016-dc-v20170711",*
* "disk_size": "50",*
* "machine_type": "n1-standard-1",*
* "zone": "us-central1-a",*
* "network": "default",*
* "subnetwork": "default",*
* "omit_external_ip": true,*
* "use_internal_ip": true,*
* "instance_name": "win-base",*
* "communicator": "winrm",*
* "winrm_username": "packer",*
* "winrm_insecure": true,*
* "winrm_timeout": "3m",*
* "winrm_use_ssl": false,*
* "metadata": { "windows-startup-script-cmd": "{{user
`startup_script`}}" }*
* }],*
* "provisioners": [{*
* "type": "powershell",*
* "inline": [*
* "dir c:\\"*
* ]*
* }]*
*}*
in logs:
2017/07/21 09:13:20 packer: 2017/07/21 09:13:20 [INFO] Attempting WinRM
connection...
2017/07/21 09:13:20 packer: 2017/07/21 09:13:20 [DEBUG] connecting to
remote shell using WinRM
2017/07/21 09:13:20 packer: 2017/07/21 09:13:20 [ERROR] connection error:
http response error: 401 - invalid content type
2017/07/21 09:13:20 packer: 2017/07/21 09:13:20 [ERROR] WinRM connection
err: http response error: 401 - invalid content type
when i'm trying to use *"winrm_use_ssl": true, *i recive trouble with *i/o
timeout.*
But more interesting fact was вiscovered on page
https://www.packer.io/docs/provisioners/powershell.html:
"The PowerShell Packer provisioner runs PowerShell scripts on Windows
machines. It assumes that the communicator in use is WinRM."
Which means: if i haven't ready-to-use WinRM - i haven't any provisioning.
Could anybody look at the issue?
--
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/8f64ef54-f559-4527-a9cb-8c32028041f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.