在我们使用saltstack推送配置文件时,会考滤到下发配置文件或代码都是不同的环境,比如开发环境,测试环境,或是qa环境,如何时来切分或是来分类了,saltstack在最初设计时都考滤的很清楚了,以下看看官方的配置和使用方法

3.3.5. States tutorial, part

This tutorial builds on topics covered in part 1part 2 and part 3. It is recommended that you begin there.

This part of the tutorial will show how to use salt’s file_roots to set up a workflow in which states can be “promoted” from dev, to QA, to production.

3.3.5.1. SALT FILESERVER PATH INHERITANCE

Salt’s fileserver allows for more than one root directory per environment, like in the below example, which uses both a local directory and a secondary location shared to the salt master via NFS:

# In the master config file (/etc/salt/master)
file_roots:
  base:
    - /srv/salt
    - /mnt/salt-nfs/base

Salt’s fileserver collapses the list of root directories into a single virtual environment containing all files from each root. If the same file exists at the same relative path in more than one root, then the top-most match “wins”. For example, if /srv/salt/foo.txt and /mnt/salt-nfs/base/foo.txt both exist, then salt://foo.txt will point to /srv/salt/foo.txt.

四月 19th, 2014

Posted In: 网络技术

无觅相关文章插件,快速提升流量