Thanks for the quick reply. That is definitely the behavior I've seen 
previously. Looking closer after your description of what happens, I note that 
the included tasks are being skipped. The failure is happening on a task that 
uses with_items, where the with_items line refers to the variable tested in the 
include/when.

Playbook/parent file:

- include: data-importer.yml
  when: instances['data-importer'] is defined


Included file 1:

- include: instance-common.yml
           description="Data Importer"
           instance=data-importer


Included file 2:

- name: create {{ description }} instance
  ec2:
    [...]
  with_items: instances[instance]["hostname"]


With this arrangement, I get

TASK: [aws-ec2 | create Data Importer instance] *******************************
fatal: [aws-vpc-hbi16058] => with_items expects a list or a set


So my problem seems to be specific to with_items and skipped tasks.

--Bret

-- 
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/DA5C654E-542E-4C73-9391-2C90B44733DD%40miranda.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to