7

我正在运行 YAML 文件中定义的多个 ansible 播放。

在最后一场比赛中,我收到以下错误:

{"failed": true, "msg": "The conditional check 'ansible_os_family == \"RedHat\"' failed. The error was: error while evaluating conditional (ansible_os_family == \"RedHat\"): 'ansible_os_family' is undefined\n

我是否需要通过收集事实或其他内容来更改任何内容ansible.cfg

4

2 回答 2

14

添加:

gather_facts: true

到你的最后一场比赛并尝试。

于 2017-01-12T16:17:25.113 回答
0

除了@helloV 的回答:

给自己和他人的便条,gathering =gather_facts:

# smart - gather by default, but don't regather if already gathered
# implicit - gather by default, turn off with gather_facts: False
# explicit - do not gather by default, must say gather_facts: True
# gathering = explicit
于 2020-05-19T14:41:26.977 回答