Ansible with Windows Shared Folder

180 views
Skip to first unread message

David Foley

unread,
Mar 31, 2020, 6:26:48 AM3/31/20
to Ansible Project
Hi,

I'm trying to roll out Microsoft DSC Using the following Playbook to install the application

---
   
- name:
      hosts
: win
      gather_facts
: false
     
#connection: win
      tasks
:
     
- name: Install DSC
        win_shell
: 'Set-DscLocalConfigurationManager -Path \\<Server Name>\DSCSource\AA-DSC\DscMetaConfigs\Approved -Verbose -Force'


     
- name: Run Pooling
        win_shell
: 'Update-DscConfiguration -Wait -Verbose'


     
- name: Get DSC
        win_shell
: 'Get-DscConfigurationStatus -All'



I'm getting the following Error:: When i run it 

fatal: [<IP Address>]: FAILED! => {"changed": true, "cmd": "powershell.exe -ExecutionPolicy Unrestricted Set-DscLocalConfigurationManager -Path \\\\<SERVER NAMER>\\DSCSource\\AA-DSC\\DscMetaConfigs\\Approved -Verbose -Force", "delta": "0:00:02.843573", "end": "2020-03-31 10:21:53.598630", "msg": "non-zero return code", "rc": 1, "start": "2020-03-31 10:21:50.755056", "stderr": "Set-DscLocalConfigurationManager : \\\\<SERVER NAMER>\\\DSCSource\\AA-DSC\\DscMetaConfigs\\Approved is not a valid \r\ndirectory.\r\nAt line:1 char:1\r\n+ Set-DscLocalConfigurationManager -Path \\\\<SERVER NAMER>\\\DSC ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (:) [Set-DscLocalConfigurationManager], ArgumentException\r\n    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.DesiredStateConfiguration.Commands.SetDscL \r\n   ocalConfigurationManagerCommand", "stderr_lines": ["Set-DscLocalConfigurationManager : \\\\<SERVER NAMER>\\\DSCSource\\AA-DSC\\DscMetaConfigs\\Approved is not a valid ", "directory.", "At line:1 char:1", "+ Set-DscLocalConfigurationManager -Path \\\\<SERVER NAMER>\\\DSC ...", "+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "    + CategoryInfo          : NotSpecified: (:) [Set-DscLocalConfigurationManager], ArgumentException", "    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.DesiredStateConfiguration.Commands.SetDscL ", "   ocalConfigurationManagerCommand"], "stdout": "", "stdout_lines": []}


Jordan Borean

unread,
Mar 31, 2020, 6:44:30 AM3/31/20
to Ansible Project
You are probably hitting the double hop issue over The WinRM. See https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#limitations for some workarounds.
Reply all
Reply to author
Forward
0 new messages