假设我在 salt-master 上,并且假设我知道一个特定的 salt minion my-minion
的名称,我如何复制一个特定的目录 /my-directory
从 salt-minion 到 master?
最佳答案
你可以通过salt.modules.cp.push来完成.但是,没有相应的 salt.states 来执行此操作。
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.
(更新) 这里建议了一些其他选项 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.
关于salt-stack - 如何在 master 上将目录从 salt minion 复制到 master?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37290549/