Trying to use salt-ssh to transfer a file (minionlessly)

829 views
Skip to first unread message

SodiumUser

unread,
Nov 13, 2014, 1:12:54 AM11/13/14
to salt-...@googlegroups.com
I have used salt-ssh to do a test ping and issue a raw shell command (e.g., a basic command).  But now when I try something more advanced like pushing down a file, it isn't working.  I created a roster file.  I created an .sls file.  I don't have msgpack-pure installed.  I am using salt 2014.1.13.

What is needed to push a file to a minionless client from a Salt Master server?

When I try this salt-ssh '*' state.highstate whitelist=special.sls
I see the hostname of the minionless server.  There is no error.

My special.sls file looks like this (in Jinja format):

/foo/bar/
  file.copy:
    - name: /foo/bar/
    - source: /srv/salt/base/
...
    - replace: False

I have every option  assigned.  When I use salt --versions-report I see that Jinja2 is "unknown."

What is wrong?  Or can someone explain how to transfer a file minionlessly?

Colton Myers

unread,
Nov 21, 2014, 5:23:18 PM11/21/14
to salt-...@googlegroups.com
I think you're looking for `file.managed`, not `file.copy`. The way you have your state set up, the minion will try to copy its local file /srv/salt/base to /foo/bar/, as that's the purpose of file.copy. You want file.managed, which allows you to fetch files from the master using the salt:// file prefix.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Github/Twitter/IRC

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages