您的位置:首页 > 其它

Saltstack实战配置client_acl

2015-11-26 22:47 483 查看
应用举例:

client_acl:
# Allow thatch to execute anything.
thatch:
- .*
# Allow fred to use test and pkg, but only on "web*" minions.
fred:
- web*:
- test.*
- pkg.*
配置实战:

[root@linux-node1 pillar]# vim /etc/salt/master  打开注释并修改用户名
client_acl:
oldboy:
- test.ping
- network.*
[root@linux-node1 pillar]# chmod 755 /var/cache/salt /var/cache/salt/master /var/cache/salt/master/jobs /var/run/salt /var/run/salt/master
[root@linux-node1 pillar]# chmod 777 /var/log/salt/master
[root@linux-node1 pillar]# /etc/init.d/salt-master restart
[root@linux-node1 pillar]# su - oldboy
[oldboy@linux-node1 ~]$ salt '*' test.ping
linux-node2.example.com:
True
linux-node1.example.com:
True
[oldboy@linux-node1 ~]$ salt '*' cmd.run 'w'
Failed to authenticate! This is most likely because this user is not permitted to execute commands, but there is a small possibility that a disk error occurred (check disk/inode usage).


本文出自 “万越天的架构师之路” 博客,请务必保留此出处http://wanyuetian.blog.51cto.com/3984643/1717249
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: