ok=3 changed=1 unreachable=0 failed=0
However, the share is not created.
I confirmed it works if I run the same batch file manually on the Windows server.
Here's my Playbook:
- name: Create shares
script: files/ui/create-shares.bat
tags: create-shares
Here's the batch script:
@ECHO OFF
SET PowerShellScriptPath=C:\create-shares.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%PowerShellScriptPath%""' -Verb RunAs}";
Here's the PowerShell script:
New-SmbShare -Name test -Path C:\test -FullAccess domain\user
Any ideas?
There is a PR for a win_share module which sounds like just what you are after though.
I will dig out the link.
Jon
https://github.com/ansible/ansible-modules-extras/pull/1213
Would be great if you could test it as it would get it one step closer to being included in Ansible.
Jon
$ cat /etc/ansible/ansible.cfg | grep library
#library = /usr/share/my_modules/
And /usr/share/my_modules is empty.