Error: 'import_playbook' has extra params

76 views
Skip to first unread message

kavya KULSHRESHTHA

unread,
Mar 5, 2018, 4:30:21 AM3/5/18
to Ansible Project
Hi,

I am using ansible 2.4.4

I have a role, where in main.yml I am importing two playbooks:

main.yml:
---
- import_playbook: prerequisites.yml
- import_playbook: install.yml

But, I am getting below error:
The error appears to have been in '/LidoFlight/lms/lms_dev_clone/playbooks/roles/prometheus/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:

---
- import_playbook: prerequisites.yml
  ^ here

exception type: <class 'ansible.errors.AnsibleParserError'>
exception: this task 'import_playbook' has extra params, which is only allowed in the following modules: command, win_command, shell, win_shell, script, include, include_vars, include_tasks, include_role, import_tasks, import_role, add_host, group_by, set_fact, raw, meta



Prior to it, I was using ansible 2.2.1.0 with "include" instead of "import_playbook"

Please help me to know what is wrong with "import_playbook"


Regards,
Kavya K





kavya KULSHRESHTHA

unread,
Mar 5, 2018, 6:40:14 AM3/5/18
to Ansible Project
Problem solved, had to use "import_tasks" instead of "import_playbook".
Reply all
Reply to author
Forward
0 new messages