client_acl 配置使用
概述:开启对系统上非root的系统用户在master上可以执行特殊的模块。这些模块名可以使用正则表达式来表示,不能指定对哪些minion执行命令。执行命令只需要切换到具体的用户即可,不需要认证。
开启配置
1
2
3
4
5
|
vim
/etc/salt/master
client_acl:
test
:
-
test
.
ping
- cmd.*
|
配置解释:test用户只能执行test.ping 和cmd模块的命令
3. 重启服务
1
|
service salt-mater restart
|
4. 验证
1
2
3
|
[
test
@localhost salt]$ salt
'*'
test
.
ping
192.168.138.128:
True
|
报错总结
[WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/master?
解决:chmod 777 /var/log/salt/master
Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased.
解决:这里是因为master的interface的地址不是0.0.0.0 导致的。改为0.0.0.0 重启服务就不报错了,这个好像是个bug
本文转自 shouhou2581314 51CTO博客,原文链接:http://blog.51cto.com/thedream/1841096,如需转载请自行联系原作者