你好,游客 登录 注册 搜索
背景:
阅读新闻

配置普通用户可以运行saltstack的模块

[日期:2016-08-23] 来源:Linux社区  作者:fujinzhou [字体: ]

client_acl 配置使用

1.概述:开启对系统上非root的系统用户在master上可以执行特殊的模块。这些模块名可以使用正则表达式来表示,不能指定对哪些minion执行命令。执行命令只需要切换到具体的用户即可
不需要认证。
2.开启配置:

vim /etc/salt/master
client_acl:
  test:
    - test.ping
    - cmd.*

配置解释:test用户只能执行test.ping 和cmd模块的命令

3.重启salt-master服务

service salt-mater restart

4.验证

[test@localhost salt]$ salt '*' test.ping
192.168.138.128:
    True

报错总结

1.[WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/master?

解决:

chmod 777 /var/log/salt/master   

2.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

本文永久更新链接地址http://www.linuxidc.com/Linux/2016-08/134508.htm

linux
相关资讯       saltstack模块 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款