A), install the configuration API
[[Email Protected]_master ~]# pipInstallpyopenssl #安装依赖包[[Email Protected]_master~]#Yum Installsalt-API #安装api服务[[Email Protected]_master~]# useradd username &&Echopassword |passwd--stdin $username #添加用户[[Email Protected]_master~]# Salt-call--local Tls.create_self_signed_cert#生成key, default directory/etc/pki/tls/ certs[[Email Protected]_master~]#VI/etc/salt/Masterrest_cherrypy:port:8000 #api端口debug:true ssl_crt: /etc/pki/tls/certs/localhost.crt Ssl_key:/etc/pki/tls/certs/localhost.keyexternal_auth:pam: #采用linux自带的加密方式saltapi: #之前添加的用户名 - .*#主机组 -'@wheel' #所需要调用的模块 (e.g., cmd.*,file.*), which represents all permissions-'@runner'[[Email Protected]_master~]# Service Salt-api Start
[Email protected]_master ~]# service Salt-master restart
Log view/var/log/salt/master or Salt-master-l debug
Test
[Email protected]_master ~]# netstat-ntlp|grep 8080[[Email Protected]_master~]# curl-k https://192.168.132.148:8000/login-h "Accept:application/x-yaml"-D username= ' Saltapi '-D password= ' Saltapi '-D eauth=pam return:-Eauth:pamexpire:1509451924.783881perms:- .*-'@wheel'-'@runner'Start:1509408724.78388 token:1887a5cdc7b675687915fa9363a54ec8224d4282user:saltapi
Saltstack API (i)