salt-stack - 如何在 master 上将目录从 salt minion 复制到 master?

标签 salt-stack devops

假设我在 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 to True 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/

相关文章:

automation - 使用多种 Cereal 瞄准 salt minion

devops - salt 栈 : Requiring packages installed before formula executed

salt-stack - 在 Master 上触发事件并在 Salt Minion 上等待 "response event"

tomcat - 如何使用 Jenkins 管道将 war 部署到tomcat?

docker - 如何在 docker 中安装 kerberos 客户端?

Azure DevOps Pipeline Program 不包含适合入口点的静态 'Main' 方法

linux - 如何使用受密码保护的私钥执行 salt 状态 git.latest

amazon-web-services - 配置对 salt-master/salt-minion 的 aws 服务的访问

Azure DevOps 发布管道权限

javascript - 如何将 getFieldValues ("Custom.RevisionCount"、 returnOriginalValue) 分配给 VSTS 自定义扩展 html 文件中的变量?