安装配置

vim /etc/salt/master

interface: 192.168.1.51
hash_type: sha256

systemctl start salt-master.service


vim /etc/salt/minion

master: 192.168.1.51
hash_type: sha256

systemctl start salt-minion.service


salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
bukatest01-office-stg-192.168.1.51
Rejected Keys:

salt-key --accept=bukatest01-office-stg-192.168.1.51.centos7
The following keys are going to be accepted:
Unaccepted Keys:
bukatest01-office-stg-192.168.1.51.centos7.sanhao.com
Proceed? [n/Y] Y
Key for minion bukatest01-office-stg-192.168.1.51.centos7 accepted.





cat /etc/salt/master.d/api.conf
rest_cherrypy:
port: 8888
disable_ssl: True


external_auth:
pam:
zrd: #用户
- .*




# =========================
https://www.jianshu.com/p/012ccdff93cc
https://www.cnblogs.com/evilliu/articles/6137336.html

api
https://blog.csdn.net/qq942477618/article/details/53437004
https://www.jianshu.com/p/6c9b34cfe3f9
# ===========================

获取token

curl -k http://192.168.1.51:8888/login  -H "Accept: application/x-yaml" -d username='zrd' -d password='changan123' -d eauth='pam' 
return:
- eauth: pam
expire: 1528580253.86816
perms:
- .*
start: 1528537053.868159
token: 1da9b2c6c0db3fc85f374a0470186363d4b6ead7
user: zrd