Reputation: 12585
Assuming I am on the salt-master, and assuming that I know the name of a specific salt minion my-minion
, How can I copy a specific directory /my-directory
from the salt-minion to the master?
Upvotes: 3
Views: 10854
Reputation: 13176
You can do it through salt.modules.cp.push. However, there is no correspondence salt.states to do this.
Push a file from the minion up to the master, the file will be saved to the salt master in the master's minion files cachedir (defaults to
/var/cache/salt/master/minions/minion-id/files
)Since this feature allows a minion to push a file up to the master server it is disabled by default for security purposes. To enable, set
file_recv
toTrue
in the master configuration file, and restart the master.
(update) some other options are suggested here Data sharing (grains/values/files) between minions and salt-master #27156
khaije1 commented on Apr 22
Though certainly not an encouraged practice, i've (1) transfered data from minion to master using only the event bus.
There are some other possibilities I haven't explored, (2) like having the minion write directly to an external pillar, or ,(3)writing the data locally on the minion to a location/system that will be cached on the master.
Upvotes: 7