【问题标题】:Salt stack top.sls pillar order盐栈 top.sls 支柱顺序
【发布时间】:2014-10-01 14:59:14
【问题描述】:

我正在尝试了解 Salt 如何在 Pillar 的 top.sls 文件中对匹配的仆从进行排序和优先级排序。

我希望 Salt 优先考虑我在 Pillar 中的条目,但我得到看似随机的排序顺序(不是第一个,不是最后一个,不是字母顺序 afaik)。我看过order option,但不想使用它(如果它甚至在 Pillars 中可用?)

/srv/pillar/top.sls

base:
  '*':
    - users
  'office-london-*':
    - office.general.london
  'office-ny-*':
    - office.general.ny
  'office-*-cust-*':
    - office.cust
  'office-*-cust-ntp*':
    - office.cust-ntp

奴才

  • office-london-cust -> office.general.london

  • office-london-cust-server1 -> office.cust

  • office-london-cust-ntp-server1 -> office.cust-ntp

  • office-ny-cust -> office.general.ny

  • office-ny-cust-server1 -> office.cust

  • office-ny-cust-ntp-server1 -> office.cust-ntp

这里有一些 Github 问题的链接,我在没有弄清楚的情况下查看过:

https://github.com/saltstack/salt/pull/1287

https://github.com/saltstack/salt/issues/13657

https://github.com/saltstack/salt/issues/1432

https://github.com/saltstack/salt/issues/14723

【问题讨论】:

    标签: salt-stack


    【解决方案1】:

    minion 将按顺序查看每个匹配行并将相应的 sls 文件添加到其要应用的 sls 文件列表中。然后,minion 将按照在 top.sls 中定义的相同顺序将该 sls 文件列表编译成数据结构。

    require语句和类似的必要条件可以修改执行顺序

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-27
      • 1970-01-01
      相关资源
      最近更新 更多