Run Powershell modules on windows container via docker connection (#67832) (#67872)

* Run modules on windows container

This provides an ability to run Powershell modules on windows container via docker connection. Otherwise, Ansible tries to run python modules on windows containers and fails.

* Removing whitespace in the blank lines

* Adding a changelog fragment

(cherry picked from commit e0eee3c37e)

Co-authored-by: Ruheena Ansari <ruheena0105@tamu.edu>
pull/67986/head
Felix Fontein 5 years ago committed by GitHub
parent 3fb4d109ce
commit e379dc76c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- docker connection plugin - run Powershell modules on Windows containers.

@ -76,6 +76,10 @@ class Connection(ConnectionBase):
# configured to be connected to by root and they are not running as
# root.
# Windows uses Powershell modules
if getattr(self._shell, "_IS_WINDOWS", False):
self.module_implementation_preferences = ('.ps1', '.exe', '')
if 'docker_command' in kwargs:
self.docker_cmd = kwargs['docker_command']
else:

Loading…
Cancel
Save