2015-09-02 49 views
1

我通過執行遵循關於如何設置windows software repositoryPkg.install上窗口回購在top.sls文件節點組

我可以在節點上手動安裝包下列指南:

salt node pkg.install 'firefox' 

如何使用pkg.install(或類似的東西)將其轉換爲top.sls文件中的配置,以便我可以使用state.highstate定位節點組並僅安裝先前未安裝的軟件?

使用來自Utah_Dave firefox的答案我將得到以下錯誤消息:(鑑於firefox已經安裝在機器上,如果我重新安裝錯誤消息/日誌類似,firefox將安裝在機器上,但仍然返回False)

my-node: 
---------- 
      ID: firefox 
    Function: pkg.installed 
     Result: False 
    Comment: The following packages failed to install/update: firefox=40.0.3 

而且從鹽僕從的調試日誌:

[DEBUG ] Fetching file from saltenv 'base', ** attempting ** 'salt://firefox.sls' 
[INFO ] Fetching file from saltenv 'base', ** done ** 'firefox.sls' 
[DEBUG ] LazyLoaded cmd.run 
[DEBUG ] Jinja search path: ['c:\\salt\\var\\cache\\salt\\minion\\files\\base'] 
[DEBUG ] Rendered data from file: c:\salt\var\cache\salt\minion\files\base\firefox.sls: 
firefox: 
    pkg.installed 
[DEBUG ] LazyLoaded config.get 
[DEBUG ] Results of YAML rendering: 
OrderedDict([('firefox', 'pkg.installed')]) 
[DEBUG ] LazyLoaded pkg.install 
[DEBUG ] LazyLoaded pkg.installed 
[DEBUG ] Error loading module.tls: ['PyOpenSSL version 0.14 or later must be installed before this module can be used.'] 
[DEBUG ] Error loading module.nacl: libnacl import error, perhaps missing python libnacl package 
[DEBUG ] Error loading module.ipmi: No module named pyghmi.ipmi 
[DEBUG ] Error loading module.npm: npm execution module could not be loaded because the npm binary could not be located 
[DEBUG ] Could not LazyLoad pkg.ex_mod_init 
[INFO ] Running state [firefox] at time 08:18:32.643000 
[INFO ] Executing state pkg.installed for firefox 
[DEBUG ] Initializing COM library 
[DEBUG ] Uninitializing COM library 
[DEBUG ] Could not LazyLoad pkg.normalize_name 
[DEBUG ] Could not LazyLoad pkg.check_db 
[DEBUG ] Could not LazyLoad pkg.normalize_name 
[DEBUG ] Initializing COM library 
[DEBUG ] Uninitializing COM library 
[WARNING ] Specified file https://download-installer.cdn.mozilla.net/pub/firefox/releases/40.0.3/win32/en-US/Firefox%20Setup%2040.0.3.exe is not present to generate hash 
[DEBUG ] Reading configuration from c:\salt\conf\minion 
[DEBUG ] file_roots is c:\salt\srv\salt 
[DEBUG ] Using GET Method 
[INFO ] Executing command ['c:\\salt\\var\\cache\\salt\\minion\\extrn_files\\base\\download-installer.cdn.mozilla.net\\pub\\firefox\\releases\\40.0.3\\win32\\en-US\\Firefox%20Setup%2040.0.3.exe', '/s'] in directory 'C:\\Users\\aes.jenkins' 
[DEBUG ] Initializing COM library 
[DEBUG ] Uninitializing COM library 
[DEBUG ] Could not LazyLoad pkg.hold 
[DEBUG ] Initializing COM library 
[DEBUG ] Uninitializing COM library 
[ERROR ] The following packages failed to install/update: firefox=40.0.3 
[INFO ] Completed state [firefox] at time 08:18:46.939000 

回答

0

貓/srv/salt/firefox.sls:

firefox: 
    pkg.installed 

貓/srv/salt/top.sls:

base: 
    'myNodeGroupName': 
    - match: nodegroup 
    - firefox 
+0

那是什麼,我試圖做的其實已經,我會更新錯誤日誌/信息的問題。 –