简体   繁体   English

使用python重新启动Minion

[英]restarting minion using python

Is there any way to restart minions with python code? 有什么办法可以用python代码重启奴才吗? using local.cmd('*', 'cmd.run', ['net stop salt-minion']). 使用local.cmd('*','cmd.run',['net stop salt-minion'])。 Will shutting down the minions and making them non-responsive is right? 关闭小伙伴并使它们不响应是对的吗?

I know service.restart and even pkg.install works with salt-minion: 我知道service.restart甚至pkg.install可以与salt- pkg.install一起使用:

local.cmd('*', 'service.restart', ['salt-minion'])

Of course, you ought to test this on a subset of minions first. 当然,您应该首先在一个小兵的子集上对此进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM