Assume the scp target is a file instead of a directory. Assuming the scp target is a file instead of a directory allows uploading files to a node being provisioned with the ssh communciator using sftp and with the winrm communicator. It is fully compatible with ansible; ansible communicators only allow for files (never directories) to be uploaded (when the copy module is used to upload a directory, ansible walks the directory and uploads files one at a time). Update documentation to explain how to provision a Windows image. Extend tests that use ssh to communicate with the node to include single files, recursive copies, and content-only recursive copies. Add test to verify support for the winrm communicator. Remove the err argument from adapter.scpExec, because it was unused. Fixes #3911
32 lines
927 B
JSON
32 lines
927 B
JSON
{
|
|
"variables": {},
|
|
"provisioners": [
|
|
{
|
|
"type": "ansible",
|
|
"playbook_file": "./win-playbook.yml",
|
|
"extra_arguments": [
|
|
"--connection", "packer",
|
|
"--extra-vars", "ansible_shell_type=powershell ansible_shell_executable=None"
|
|
]
|
|
}
|
|
],
|
|
"builders": [
|
|
{
|
|
"type": "googlecompute",
|
|
"account_file": "{{user `account_file`}}",
|
|
"project_id": "{{user `project_id`}}",
|
|
"image_name": "packerbats-winrm-{{timestamp}}",
|
|
"source_image": "windows-server-2012-r2-dc-v20160916",
|
|
"communicator": "winrm",
|
|
"zone": "us-central1-a",
|
|
"disk_size": 50,
|
|
"winrm_username": "packer",
|
|
"winrm_use_ssl": true,
|
|
"winrm_insecure": true,
|
|
"metadata": {
|
|
"sysprep-specialize-script-cmd": "winrm set winrm/config/service/auth @{Basic=\"true\"}"
|
|
}
|
|
}
|
|
]
|
|
}
|