saltstack之halite

你們都知道cmd.run這個方法好用,能夠遠程調用命令觸發遠端機器運行,
和同事討論的時候發現halite這個平臺就是針對這個方法而製做的web平臺界面,
搭建容易
至於有研究的同窗可發現,其實halite就是salt-api的替代品


搭建過程:

cd /data/apps/

git clone https://github.com/saltstack/halite

cd halite/halite

./genindex.py -C

#salt-api版本在0.8.2或以上,可使用pip安裝,中國就有點慢,你們都懂得
pip install salt-api

pip install cherrypy

#在master添加配置文件

rest_cherrypy:
  port: 8000
  debug: True
  static: /data/apps/halite/halite
  app: /data/apps/halite/halite/index.html
  ssl_crt: /etc/salt/pki/localhost.crt
  ssl_key: /etc/salt/pki/localhost.key

證書我是本身生成的

#生成ssl認證密鑰
openssl genrsa -des3 -out localhost.key 1024
openssl req -new -key localhost.key  -out localhost.csr
openssl x509 -req -in localhost.csr  -signkey localhost.key -out localhost.crt
mv localhost.* /etc/salt/pki/.

#啓動
salt-api -d
#須要用到salt的eauth系統,在master添加配置,
external_auth:
   pam:
      liji*****:     (此用戶爲系統用戶名,使用系統認證)
       - .*
#訪問
http://localhost:8000/app
相關文章
相關標籤/搜索