小编fbi*_*nel的帖子

如何仅根据条件通知 Ansible 中的处理程序?

我想通过执行以下操作来通知担任我角色的处理程序:

- name: Notify handler
  notify: my_handler
  when: this_thing_is_true|bool
Run Code Online (Sandbox Code Playgroud)

但 Ansible 只是抱怨:

错误!任务中未检测到模块/操作。

我尝试过各种楔子,例如:

- name: Notify handler
  meta: noop
  notify: my_handler
  when: this_thing_is_true|bool
Run Code Online (Sandbox Code Playgroud)

但同样的抱怨是:

[警告]:有条件时不支持 noop 任务

有什么建议么?

notify conditional-statements ansible

14
推荐指数
2
解决办法
1万
查看次数

标签 统计

ansible ×1

conditional-statements ×1

notify ×1