Ansible-使用“ include”和“ include_tasks”模块

时间:2019-01-03 08:18:28

标签: ansible ansible-2.x ansible-galaxy

我已经下载了here,并且在运行该角色时遇到以下错误:

The error appears to have been in '/some_folder/geerlingguy.docker/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- include_tasks: setup-RedHat.yml
  ^ here

,当我用include_task模块替换模块include模块时,一切正常。

什么原因导致了此问题?

1 个答案:

答案 0 :(得分:1)

如果您使用的Ansible版本低于2.4,则可以预期,因为include_task是在Ansible 2.4中引入的 https://docs.ansible.com/ansible/2.4/include_tasks_module.html