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
17 lines
511 B
Python
17 lines
511 B
Python
from __future__ import (absolute_import, division, print_function)
|
|
__metaclass__ = type
|
|
|
|
from ansible.plugins.connection.ssh import Connection as SSHConnection
|
|
|
|
class Connection(SSHConnection):
|
|
''' ssh based connections for powershell via packer'''
|
|
|
|
transport = 'packer'
|
|
has_pipelining = True
|
|
become_methods = []
|
|
allow_executable = False
|
|
module_implementation_preferences = ('.ps1', '')
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super(Connection, self).__init__(*args, **kwargs)
|