salt master 可以为不可用的 minions 提供状态吗?

Can a salt master provide a state to unavailable minions?

背景:我有几台服务器,运行 我开发了一项服务。他们都应该拥有相同的服务副本。

为了确保部署和最新性,我使用 Ansible,以及部署服务的幂等剧本。由于服务器位于不可靠的网络上,我必须定期 运行 剧本(在 cron 作业中)以访问以前可能不可用的服务器。

问题:我的印象是 SaltStack 的哲学是不同的:我虽然我可以 "set a state, compile it and offer to a set of minions. These minions would then, at their own leisure, come to the master and get whatever they need to do"

情况似乎并非如此:跳过部署时不可用的 minions。

问题:是否有允许异步部署的机制,在某种意义上,主服务器上的状态设置仅一次 一旦他们准备好/可以到达主人,他们就会被奴才拉动并应用(对他们自己)?

具体来说,不需要不断地向所有 minions 重新提供相同的状态,希望过去不可用的 minions 现在能够获得更新。

每次 minion 连接到 master 时,事件总线上都会有一个事件,您可以对其做出反应。

Reactor

这是 Ansible 和 Saltstack 的主要区别。

为了做你想做的事,我会对每个小兵的重新连接做出反应,并尝试应用一个幂等的状态。

Idempotent

您还可以在 Saltstack 中设置计划任务,每 X 分钟运行一次状态并应用所需的配置。

Scheduled task

answer from Daniel Wallace(盐开发者):

That is not possible.

The minions connect to the publish port/bus and the master puts new jobs on that bus. Then the minion picks it up and runs the job, if the minion is not connected when the job is published, then it will not see the job.