ERROR! this task 'import_playbook' has extra params

568 views
Skip to first unread message

John Harmon

unread,
Mar 13, 2018, 3:12:27 PM3/13/18
to Ansible Project
I can't figure out why this is failing... syntax is correct as far as I can see.  I could use another pair of eyes.

ERROR:
ERROR! 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

...

The offending line appears to be:

# tasks file for user rights
- import_playbook: /playbooks/one-offs/update_gitlab_scripts.yml


Top part of playbook:
- import_playbook: /playbooks/one-offs/update_gitlab_scripts.yml

The following also fails:
- import_playbook: update_gitlab_scripts.yml

So, the last is pretty basic.... unsure why it is throwing the error that it is throwing.  This is in the r

John Harmon

unread,
Mar 13, 2018, 3:16:29 PM3/13/18
to Ansible Project
Previous comment cut off... here is what it was supposed to say
 
So, the last is pretty basic.... unsure why it is throwing the error that it is throwing.  This is in the role/tasks/main.yml file

Kai Stian Olstad

unread,
Mar 13, 2018, 3:23:39 PM3/13/18
to ansible...@googlegroups.com
import_playbook is only allowed in a playbook on top level, not in a role.

--
Kai Stian Olstad

John Harmon

unread,
Mar 13, 2018, 3:27:33 PM3/13/18
to Ansible Project
I was wondering that myself, but the docs showed examples doing otherwise.... but I couldn't get it to work.  I need to call the playbook before roles, which also seems to fail.  Do you know of a way to import_playbook before executing a role or set of roles?

Kai Stian Olstad

unread,
Mar 13, 2018, 3:31:33 PM3/13/18
to ansible...@googlegroups.com
On 13.03.2018 20:27, John Harmon wrote:
> I was wondering that myself, but the docs showed examples doing
> otherwise.... but I couldn't get it to work. I need to call the
> playbook
> before roles, which also seems to fail. Do you know of a way to
> import_playbook before executing a role or set of roles?

If you look at the documentation carefully you see the example has this
name
"- name: This DOES NOT WORK"


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages