Shahid Karimi
Shahid Karimi

Reputation: 4357

Ansible include_tasks giving syntax error

Ansible version: 2.9

Play book

---
- { include_tasks: test.yml }

Error

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
'}}

Fighting with this for few days! Please rescue.

Upvotes: 1

Views: 731

Answers (1)

Jack
Jack

Reputation: 6158

What you posted is not a playbook. You need to list hosts and tasks:

---
- hosts: all
  tasks:
  - include_tasks: test.yml

Upvotes: 1

Related Questions