【发布时间】:2021-04-30 19:12:42
【问题描述】:
我将assert module 中的quiet 参数用于输出过于冗长的任务。 quiet 参数是在 Ansible 2.8 中引入的,但不幸的是,我的代码有时需要在 Ansible 2.7 中仍然附带的 Debian Buster 上运行。
在这种情况下,Ansible 会失败并出现致命错误“Unsupported parameters for (assert) module: quiet”。由于这只是一个装饰性参数,我希望 Ansible 2.7 忽略此参数并继续。
有没有办法在我的任务中添加这个参数,这样 Ansible 2.8 又好又安静,但任务仍然在 Ansible 2.7 中运行?
- name: Silent assert
assert:
that:
- true
quiet: yes
【问题讨论】:
标签: ansible backwards-compatibility