2015-05-28 31 views
1

我是Saltstack的新手,我只是想對一些小工具做一些簡單的安裝。我想包括環境,所以我有我的根文件如:saltstack apache-formula的基本用法問題

file_roots: 
    base: 
    - /srv/salt/base 
    dev: 
    - /srv/salt/dev 
    qa: 
    - /srv/salt/qa 
    stage: 
    - /srv/salt/stage 
    prod: 
    - /srv/salt/prod 

我設置的git的後端:

fileserver_backend: 
    - git 
    - roots 

我使用設置爲gitfs:

gitfs_remotes: 
    - https://github.com/saltstack-formulas/postgres-formula 
    - https://github.com/saltstack-formulas/apache-formula 
    - https://github.com/saltstack-formulas/memcached-formula 
    - https://github.com/saltstack-formulas/redis-formula 

所以我有主人設置,並且我將top.sls添加到/ srv/salt /舞臺上

include: 
    - apache 
stage: 
    'stage01*': 
     - apache 

但我得到一個錯誤,當我執行

salt -l debug \* state.highstate test=True 

錯誤

stage01.example.net: 
Data failed to compile: 
---------- 
No matching sls found for 'apache' in env 'stage' 

我試過很多方法,主似乎無法找到apache的公式我爲它配置。

+0

您是否按照此處所述安裝了依賴項pygit2 https://docs.saltstack.com/en/latest/ref/file_server/all/salt.fileserver.gitfs.html? – ahus1

+0

是的。我確實遇到了缺少依賴關係的問題,但在我遇到此問題之前將其排除。 – Clutch

回答

2

我找到了答案,它始終坐在Saltstack文檔中。

  1. 首先你需要分叉當前的倉庫,比如postgres-formula。
  2. 根據環境的不同,在新創建的回購叉中創建一個具有相同名稱的分支。

因此,例如我想在我的階段環境中使用postgres。所以它不會工作,直到我創建了一個名爲的分支階段進入postgres-formula的分叉回購,然後它像一個魅力。