Ansible include_tasks提供语法错误

问题描述 投票:0回答:1

Ansible版本:2.9

[游戏书

---
- { include_tasks: test.yml }

错误

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

The offending line appears to be:

- { include_tasks: test.yml}
  ^ here
'}}

为此战斗几天!请营救。

ansible ansible-2.x ansible-api
1个回答
0
投票

您发布的不是剧本。您需要列出主机和任务:

---
- hosts: all
  tasks:
  - include_tasks: test.yml
© www.soinside.com 2019 - 2024. All rights reserved.