Re: [ansible-project] BUG? 'AnsibleSequence' object has no attribute 'strip'

70 views
Skip to first unread message

Kai Stian Olstad

unread,
Feb 14, 2018, 12:53:36 AM2/14/18
to ansible...@googlegroups.com
On 14.02.2018 00:30, John Harmon wrote:
> I don't know if I have a syntax issue or a bug. Thought before filing
> a
> bug I would see what you guys thought. I have a bunch of
> roles/playbooks I
> wish to execute against new servers. Here is what I have come up with.
> ansible-2.4.3.0-1.el7.ans.noarch
>
>
> Playbook:
> ---
> - hosts: "{{ host }}"
>
> roles:
> - ansible_dependencies
> - aliases

<snip />

>
> import_playbook:
> - /playbooks/one-offs/bash_history.yml -e host= "{{ host }}"
> - /playbooks/one-offs/dmesg_timestamps.yml -e host= "{{ host }}"
> - /playbooks/one-offs/grub_cmdline.yml -e host= "{{ host }}"

import_playbook is not a directive for a play, since it's a file with
one or more play it's a directive on the top level.
So you need a dash in front and move it all the way to the left.

import_playbook doesn't take a list of playbook files, a little hint is
that it's _playbook not _playbooks.

-e is misplaced, -e is a command line option so remove that.

It's not allowed to have space in-front or after the equal sign in
Ansible yaml syntax.

So try

- import_playbook: /playbooks/one-offs/bash_history.yml host="{{ host
}}"
- import_playbook: /playbooks/one-offs/dmesg_timestamps.yml host="{{
host }}"
...
...


--
Kai Stian Olstad

Brian Coca

unread,
Feb 14, 2018, 8:29:05 PM2/14/18
to Ansible Project
Actually, you should write it like this:

- import_playbook: /playbooks/one-offs/bash_history.yml
vars:
host: "{{ host }}"

- import_playbook: /playbooks/one-offs/dmesg_timestamps.yml
vars:
host: "{{ host }}"


--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages