It seems this should work according to the docs.  It does work if I use

with_items: app1


$ cat jj.yml
---
- hosts: all

  vars:
    app1:
      - base: "{{ file | basename }}"

    app2:
      - base: "{{ file }}"

  tasks:
      - name: debug
        debug: msg="{{ item.base }}"
        with_items:
          - app1
          - app2

$ ansible-playbook ./jj.yml -i hosts --extra-vars 'file=/tmp/jj'
...
TASK: [debug]
*****************************************************************
fatal: [myhost] => One or more undefined variables: 'str' object has no
attribute 'base'

What am I doing wrong?  Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABdN8i05KDF%2BdO0y%2B8ZApsixbqdCfrtrRjf9vwxeZ0hJ87Ueeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to