我是Saltstack的新手,我只是想对一些奴才做一些简单的安装 . 我想要包含环境,所以我的文件根源为:
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 / stage
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公式 .
1 回答
我找到了答案,它一直坐在Saltstack文档中 .
首先,您需要分叉当前存储库,例如postgres-formula .
根据环境,在repo的新创建分支中创建同名分支 .
所以例如我想在我的 stage 环境中使用postgres . 所以直到我创建了一个名为 stage 的分支,我的分支回购postgres-formula然后它就像一个魅力就行了 .