Re: [ansible-project] How to specify foldername with wildcard inside a jinja template

2020-03-07 Thread Dick Visser
Try the 'lines' lookup with a custom 'find' shell command ?


On Sat, 7 Mar 2020 at 06:27, Shifa Shaikh  wrote:
>
> I wish to check using if condition inside a jinja template where any of the 
> folders starting with the name "dump_" has any file starting with the name bad
>
> For for single folder the below jinja template works as suggested by an 
> expert on this forum.
>
>  {% if lookup('fileglob', playbook_dir + '/' + 'dump_' + item + '/' + 
> 'bad*.txt') %}
>
>
> I understand that fileglob supports wildcards only on files and not on 
> folders.
>
> The below fails when wildcard is applied to a folder.
>
> {% if lookup('fileglob', playbook_dir + '/' + 'dump_*' + '/' + 'bad*.txt') %}
>
>
>
> Any solution to this problem please inside a jinja template?
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/da0c72f2-1fb2-45cc-88e3-540de05015ca%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwOpudauvkKPxnbAW8ykWVLu7VLRzCXiLjXdvq2wLQCBLA%40mail.gmail.com.


[ansible-project] How to specify foldername with wildcard inside a jinja template

2020-03-06 Thread Shifa Shaikh
I wish to check using if condition inside a jinja template where any of the 
folders starting with the name "dump_" has any file starting with the name 
bad

For for single folder the below jinja template works as suggested by an 
expert on this forum. 

 {% if lookup('fileglob', playbook_dir + '/' + 'dump_' + item + '/' + 
'bad*.txt') %}


I understand that fileglob supports wildcards only on files and not on 
folders.

The below fails when wildcard is applied to a folder.

{% if lookup('fileglob', playbook_dir + '/' + 'dump_*' + '/' + 'bad*.txt') 
%}



Any solution to this problem please inside a jinja template?

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/da0c72f2-1fb2-45cc-88e3-540de05015ca%40googlegroups.com.