cp.get-file

531 views
Skip to first unread message

Eliyahu Grumman

unread,
May 9, 2012, 10:36:39 AM5/9/12
to salt-...@googlegroups.com
Hi- I have a question regarding transfer files to minion. I try to use cp.get-file

salt 'eliyahu-VirtualBox' cp.get_file salt://home/ec2-user/salt/this.tar /home/eliyahu/build     # the first path is the path to file in master an  sec path is the dest in the minion.

response is  {'eliyahu-VirtualBox' : ' '}
in actual file not transferred. 

I read in the code this '' causes maybe because this salt path is not hash.

but I checked it with cp.hash_file salt://home/ec2-user/salt/this.tar on the local minion- and I get the hash number. but in my 'eliyahu-VirtualBox' again result is : ' '

how it really works? I try few ways =/ cannot reproduce this command..

halberom

unread,
May 9, 2012, 11:02:45 AM5/9/12
to salt-...@googlegroups.com
Hello Eliyahu

Your source seems a bit odd, can you confirm what your "file_roots:" section looks like in your /etc/salt/master.

Do other state calls work?

Thomas S Hatch

unread,
May 9, 2012, 12:22:28 PM5/9/12
to salt-...@googlegroups.com
Hi Eliyahu,

Are you trying to copy a file from the master to the minion? Or from the minion to the master?

Eliyahu Grumman

unread,
May 9, 2012, 12:28:19 PM5/9/12
to salt-...@googlegroups.com
from master to minion.

is the source should be from the dircet of file_roots? where is it?  I didn't set this parameter in the master config. 

I thing that requires the full server source. 

I don't use states. I use CLI commands.

halberom

unread,
May 9, 2012, 12:44:26 PM5/9/12
to salt-...@googlegroups.com
Using the cp module and source "salt://" requires that the files exist in a folder structure that Salt knows about - this by default is /srv/salt (defined in /etc/salt/master)

i.e. if you do the following

mkdir -p /srv/salt
mv /home/ec2-user/salt/this.tar /srv/salt

then the following should work
salt 'eliyahu-VirtualBox' cp.get_file salt://this.tar /home/eliyahu/build

Eliyahu Grumman

unread,
May 9, 2012, 4:00:55 PM5/9/12
to salt-...@googlegroups.com
works! thanks =)))
Reply all
Reply to author
Forward
0 new messages