Using ROBOCOPY through Salt Master

0

I have SLS files set up to copy things from a network folder to a local directory on a minion.

Looks a little like this: cmd-test: cmd.run: - name: 'ROBOCOPY \\\CygwinSource C:\CygwinSource /E'

and get the following output:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Tuesday, December 6, 2016 10:50:35 AM
2016/12/06 10:50:35 ERROR 1808 (0x00000710) Getting File System Type of Source \\<Server>\<program>\<file>\
The account used is a computer account. Use your global user account or local user account to access this server.


   Source - \\<Server>\<program>\<folder>\
     Dest : C:\<path>\<folder>\

    Files : *.*

  Options : *.* /S /E /DCOPY:DA /COPY:DATS /PURGE /MIR /NP /R:1 /W:1 

------------------------------------------------------------------------------

NOTE : NTFS Security may not be copied - Source may not be NTFS.

2016/12/06 10:50:35 ERROR 1808 (0x00000710) Accessing Source Directory \\<Server>\<program>\<file>\
The account used is a computer account. Use your global user account or local user account to access this server.

Waiting 1 seconds... Retrying...

When I run the same thing locally in command line as 'ROBOCOPY \\\CygwinSource C:\CygwinSource /E' and it worked perfectly. I have no idea how to fix this 'use local user account' that Robocopy seems to give when using it through salt.

I also tried adding /MIR and /SEC which didnt't work.

Running Windows 10, Minion 2016.3.3 Master: Red Hat, 2016.3.3

salt
robocopy
asked on Stack Overflow Dec 7, 2016 by dwr123123d12

1 Answer

1

Salt seems to be connecting to the network resource with a computer account. A few possible solutions:

  1. Try changing the Salt Service on the Client (if that's how salt is executing the commands) to run as a domain user.
  2. Try using the salt file server
  3. Implement this hacky workaround where a scheduled task is created - discussed in the github issue that seems related to your problem: https://github.com/saltstack/salt/issues/16340
answered on Stack Overflow Dec 7, 2016 by Chris N

User contributions licensed under CC BY-SA 3.0