2016-02-05 26 views
0

我有以下SLS文件:如何在salt狀態下執行pkg.refresh_db?

python: 
    pkg.installed: 
    - pkgs: 
     - python2_x64 

我如何可以編輯這個文件,以確保pkg.refresh_db之前attepting安裝Python執行?

我可以手動運行這樣的刷新:salt -G 'os:windows' pkg.refresh_db

回答

1
pkg: 
module.run: 
    - name: pkg.refresh_db 

python: 
pkg.installed: 
    - pkgs: 
    - python2_x64 
+0

或只是'PKG。 refresh_db:module.run'(下一行的第二個關鍵字,縮進)。 – sebastian

0

添加refresh: Truepkg.installed狀態:

python: 
    pkg.installed: 
    - pkgs: 
     - python2_x64 
    - refresh: True 

甚至更​​短:

python2_x64: 
    pkg.installed: 
    - refresh: True 
相關問題