他们上网后,对小兵施加状态

想象一下,你想在一群奴才中应用一些状态,比如所有的Ubuntu客户端。 当我们申请国家时,有些奴才是离线的。

消息总线上的状态保留多长时间才能被推送到随从上? 你提出什么样的策略来解决这个问题,并在他们回来的时候改变奴才的状态? 有没有更好的方式使小salt-call state.highstate拉状态比运行salt-call state.highstate

盐来与所谓的反应堆系统 ,这应该适合您的需求。

以下是未经testing并从链接的文档中提取的。

/etc/salt/master.d/reactor.conf

 reactor: - 'salt/minion/*/start': # Match the start event - /srv/reactor/start.sls # Things to do when a minion starts 

/srv/reactor/start.sls

 highstate_run: local.state.apply: - tgt: data['id'] # data included event data, id is the minion id. 

这应该确保在与盐主打开连接之后, 每个 state.highstate 应用state.highstate