SaltGUI的安装

1.下载代码

cd /data/salt-web/

gitlab

git clone https://github.com/erwindon/SaltGUI.git

gitee拷贝的1.30.0 (2023-11-11)版本

git clone https://gitee.com/xiaoxiaomuyuyu/SaltGUI.git

目录为/data/salt-web/SaltGUI/

2.修改salt-master配置文件

需要先安装salt-api与pyOpenSSL

yum -y install salt-api pyOpenSSL

修改配置文件,这个配置文件是salt-api的netapi.rest_cherry模块

https://docs.saltproject.io/en/3006/ref/netapi/all/salt.netapi.rest_cherrypy.html#authentication

下面的配置是关闭了ssl,disable_ssl: True

复制代码
vim /etc/salt/master.d/api.conf
rest_cherrypy:
port: 8001
disable_ssl: True
host: 0.0.0.0
#ssl_crt: /etc/pki/tls/certs/localhost.crt
#ssl_key: /etc/pki/tls/certs/localhost.key
#debug: True
app: /data/salt-web/SaltGUI/saltgui/index.html
static: /data/salt-web/SaltGUI/saltgui/static
#static_path: /static
复制代码

如果要开启ssl,需要先生成证书

salt-call --local tls.create_self_signed_cert

此时在/etc/pki/tls/certs/中生成localhost.crt和localhost.key证书。

复制代码
vim /etc/salt/master.d/api.conf
rest_cherrypy:
port: 8001
#disable_ssl: True
host: 0.0.0.0
ssl_crt: /etc/pki/tls/certs/localhost.crt
ssl_key: /etc/pki/tls/certs/localhost.key
#debug: True
app: /data/salt-web/SaltGUI/saltgui/index.html
static: /data/salt-web/SaltGUI/saltgui/static
#static_path: /static
复制代码

但是配置后要显示cherrypy.process.wspbus.ChannelFailures: PermissionError(13, 'Permission denied')没有权限。这是因为localhost.crt和localhost.key文件权限不够,需要添加权限

chmod +r localhost.key 
chmod +r localhost.crt

再次重启

systemctl restart salt-master.service

systemctl restart salt-api.service  

可以进行https的访问

 

posted @   潇潇暮鱼鱼  阅读(96)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示