I'm running Ansible 2.0.0.2 on a Ubuntu 14.04 Control Machine. I'm using
the script module in my Playbook to run a batch file, which executes a
PowerShell script to create a Windows share (Windows Server 2012 R2). The
Playbook completes successfully:
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?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/15d64f82-7fe9-4d22-ba72-5fc90436a40a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.