Ansible – Create a new directory on a CIFS shared folder

In this post, I will show you how to create a directory on a CIFS shared folder hosted on the Windows machine

This task can be achieved by configuring the WinRM listener on the Windows machine. In the playbook, we will communicate with the listener using CredSSP. The TCP port is defined on 5986 (WinRM default port for HTTPS listener)

You can find here a documentation on how to configure this WinRM listener

2 thoughts on “Ansible – Create a new directory on a CIFS shared folder

  • September 17, 2019 at 09:17
    Permalink

    i facing error while running this module.
    can you please help.
    ERROR :
    « module_stderr »: « An error occurred while creating the pipeline.\r\n + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordE \r\n xception\r\n + FullyQualifiedErrorId : RuntimeException\r\n \r\nException calling \ »Run\ » with \ »1\ » argument(s): \ »Exception calling \ »Invoke\ » with \r\n\ »0\ » argument(s): \ »The running command stopped because the preference variable \r\n\ »ErrorActionPreference\ » or common parameter is set to Stop: Access is denied\ »\ »\r\nAt line:47 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordE \r\n xception\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n », « module_stdout »: «  », « msg »: « MODULE FAILURE », « rc »: 1}

    Reply
    • September 17, 2019 at 08:26
      Permalink

      Hello Saradhi, you have an access denied error. You have to check if the ansible user you use, have the correct permissions to create the folder.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By : XYZScripts.com
%d bloggers like this: