Using with_fileglob with include statement

47 views
Skip to first unread message

Karol Stępniewski

unread,
Jun 12, 2015, 3:38:07 PM6/12/15
to ansible...@googlegroups.com
Hi,

My goal is to include all playbooks from a certain directory. Those playbooks will be generated dynamically, so I wanted to avoid specifying exact names of each playbook.

I tried:

- include: "{{ item }}"
  with_fileglob
:
   
- gen_playbooks/*.yml
  when: # some condition


But I've got:

ERROR: file could not read: /mnt/ansible/{{ item }}



Looks like {{ item }} is not being evaulated in this context.

Is there any other way to do what I want to achieve?

Best Regards,
Karol

Brian Coca

unread,
Jun 12, 2015, 4:08:35 PM6/12/15
to ansible...@googlegroups.com
er .. no, but this will work:

ansible-playbook gen_playbooks/*.yml
> --
> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9a03d7a6-7401-430e-a7e3-3d028a9dd78d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



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