歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> 配置普通用戶可以運行saltstack的模塊,普通用戶saltstack

配置普通用戶可以運行saltstack的模塊,普通用戶saltstack

日期:2017/3/6 9:21:58   编辑:學習Linux

配置普通用戶可以運行saltstack的模塊,普通用戶saltstack


配置普通用戶可以運行saltstack的模塊,普通用戶saltstack


client_acl 配置使用

1.概述:開啟對系統上非root的系統用戶在master上可以執行特殊的模塊。這些模塊名可以使用正則表達式來表示,不能指定對哪些minion執行命令。執行命令只需要切換到具體的用戶即可 不需要認證。 2.開啟配置:
vim /etc/salt/master
client_acl:
  test:
    - test.ping
    - cmd.*

  
配置解釋:test用戶只能執行test.ping 和cmd模塊的命令

3.重啟salt-master服務

service salt-mater restart

4.驗證

[test@localhost salt]$ salt '*' test.ping
192.168.138.128:
    True

  

報錯總結

1.[WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/master?

解決:

chmod 777 /var/log/salt/master

  

2.Salt request timed out. The master is not responding. If this error persists after verifying the master is up, worker_threads may need to be increased.

這裡是因為master的interface的地址不是0.0.0.0 導致的。改為0.0.0.0 重啟服務就不報錯了,這個好像是個bug

http://xxxxxx/Linuxjc/1151840.html TechArticle

Copyright © Linux教程網 All Rights Reserved