saltstack web halite 界面部署文档

2017/4/15 posted in  Linux

安装saltstack webui halite管理界面,方便查看和操作
安装部署自动化管理工具SaltStack.在管理多台服务器上,这个工具还是非常好使的,另外由于是 Python写的,也可以很方便的对其进行个性化修改.

安装halite

cd /var/www/ 
git clone https://github.com/saltstack/halite
[root@master halite]# pwd
/var/www/halite/halite
[root@master halite]# ./genindex.py -C #生成index.html文件:

安装salt-api

yum install salt-api

配置salt master文件

配置salt的master文件,添加:

[root@master ~]# vim /etc/salt/master
rest_cherrypy:
host: 0.0.0.0
port: 8080
debug: true
static: /var/www/halite/halite
app: /var/www/halite/halite/index.html
external_auth:
pam:
rui:
- .*
- '@runner'
- '@wheel'

重启master

[root@master ~]# /etc/init.d/salt-master restart
Stopping salt-master daemon: [ OK ]
Starting salt-master daemon: [ OK ]

添加登陆用户

[root@master ~]# useradd rui
[root@master ~]# passwd rui
Changing password for user rui.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

启动 salt-api

salt-api -d 或 
cd /var/www/halite/halite
python server_bottle.py -d -C -l debug -s cherrypy
[root@master ~]# cd /var/www/halite/halite/
[root@master halite]# python server_bottle.py -d -C -l debug -s cherrypy
20170415_103758.177076 Bottle: Running web application server 'cherrypy' on 0.0.0.0:8080.
20170415_103758.177237 Bottle: CORS is disabled.
20170415_103758.177289 Bottle: TLS/SSL is disabled.
20170415_103758.177335 Bottle: Server options:
{}
20170415_103758.417684 Bottle: Running web application server 'cherrypy' on 0.0.0.0:8080.
20170415_103758.417833 Bottle: CORS is disabled.
20170415_103758.417886 Bottle: TLS/SSL is disabled.
20170415_103758.417931 Bottle: Server options:
{}
Bottle v0.12-dev server starting up (using CherryPyServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-C to quit.