【问题标题】:salt-stack - 'onchange' directive misunderstood or ignored?salt-stack - 'onchange' 指令被误解或忽略?
【发布时间】:2017-08-02 15:12:17
【问题描述】:

我正在尝试写我的第一个状态:

custom:
  pkg.installed:
  - sources:
    - custom_repo: http://yum.custom.com/custom_repo.noarch.rpm
  - require:
    - pkg: epel
  cmd.run:
  - name: rpm --import http://yum.custom.com/RPM-GPG-KEY
  - onchanges:
    - pkg: custom

cmd.run 继续执行,即使有onchanges 指令。因此,据我了解,如果存在包,则不应执行 cmd.run 模块。

我错过了什么?

【问题讨论】:

    标签: yaml salt-stack


    【解决方案1】:

    感谢@alejdgs编辑,我能够解决我的问题...

    它根本不是“onchange”,而是“onchanges”

    现在我要挖一个深坑,再也不出来了。天哪,我是瞎子。

    【讨论】:

    • 我觉得奇怪的是,salt 没有警告我语法错误
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-02
    • 2016-05-18
    • 2017-06-01
    • 1970-01-01
    • 2015-03-27
    • 2021-04-11
    • 2014-05-12
    相关资源
    最近更新 更多