1、salt-api删除key报没有权限!
修改/etc/salt/master.d/文件夹下的,eauth.conf
external_auth:
pam:
saltapi: # 用户
- .* # 该配置文件给予saltapi用户所有模块使用权限,出于安全考虑一般只给予特定模块使用权限
- '@runner'
- '@wheel'
salt-api的用户添加wheel的权限。
参考:
python 操作 saltstack Api(二) 示例 - FRESHMANS - 博客园
saltstack api wheel模块报错HTTP/1.1 401 Unauthorized_weixin_34405925的博客-优快云博客
简单测试:
from devops.lib.saltcommand import SaltCommand
salt = SaltCommand().get_salt_handle()
node_name = 'bb93e33f-dd75-42a7-a4f2-ec3d429c146b'
result = salt.salt_delete_key(node_name)
print(result)
2、[WARNING ][11366] IMPORTANT: Do not use md5 hashing algorithm! Please set "hash_type" to SHA256 in Salt Minion config!
报上面的错误是因为加密算法出了问题,打开minion的配置文件,找到如下的配置项进行修改!
# hash_type: md5
或者
# hash_type: sha256
改成
hash_type: sha256
3、[WARNING ] Key 'file_ignore_glob' with value None has an invalid type of NoneType, a list is required for this value
/etc/salt/master的配置文件中,将file_ignore_glob的注释全部打开,重启master即可。
4、Unable to call _return_pub_multi on 192.168.xx.xx, trying another...
The minion failed to return the job information for job xxxxxxxxxxxxxxxxxxxxxxxx. This is often due to the master being shut down or o...hreads value.
未解决
5、salt-master[8155]: [ERROR ] An extra return was detected from minion xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, please verify the minion, this could be a replay attack
未解决