error in import playbook

11 views
Skip to first unread message

Dmitriy Trubov

unread,
Aug 21, 2019, 1:07:25 PM8/21/19
to Ansible Development
hi, 
here is simple example:

wrapper play book
---
- name: Test Wrapper Playbook

  hosts: all
  tasks:

  - name: Storage console
    debug:
      msg: "Test Wrapper Play book"
    tags:
    - always
    
  - name: Precheck Storage Console
    import_playbook: "playbooks/test_playbook.yml"

_____________________________

Test playbook:
---
- name: Test Playbook

  hosts: all
  tasks:

  - name: Storage console
    debug:
      msg: "Test Play book"
    tags:
    - always

_____________________________________

Here is error:

ERROR! this task 'import_playbook' has extra params, which is only allowed in the following modules: shell, win_shell, include_vars, add_host, raw, include_role, meta, set_fact, include, import_tasks, script, import_role, include_tasks, group_by, command, win_command

The error appears to have been in '/scratch/xxxx/fr-crosscomponent-role/playbooks/test_wrapper.yml': line 13, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  - name: Precheck Storage Console
    ^ here

What is wrong?





Bob Harold

unread,
Aug 21, 2019, 3:27:28 PM8/21/19
to Dmitriy Trubov, Ansible Development
In a yaml file it is usual one of:
1. Indentation does not line up
2. tabs vs spaces (they look the same, but count as different indents)
3. invisible characters (look like blanks or none, but are not understood by the program)

I don't see anything, but the mail client could have changed characters.
yaml still confuses me.
Should "- always" be indented more?

-- 
Bob Harold

Reply all
Reply to author
Forward
0 new messages