Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File exists filter #18

Closed
jayvdb opened this issue May 12, 2018 · 3 comments
Closed

File exists filter #18

jayvdb opened this issue May 12, 2018 · 3 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented May 12, 2018

Ansible has a file exists filter which would be very helpful for building templates which are based on the files in the repo.

A possible complication is that files may be in targets and not yet generated.

@chfw
Copy link
Member

chfw commented May 12, 2018

OK. You have done the home work for me then. I could see that you like the following lines in the MANIFEST.in:

{% if exists('CHANGELOG.rst'%}include CHANGELOG.rst{%endif%}

Let me have a thought on this one.

@jayvdb
Copy link
Member Author

jayvdb commented May 13, 2018

Ya. Or {% if 'CHANGELOG.rst' | exists %}

Strangely I cant see it in http://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html

But they are listed at https://ansible-manual.readthedocs.io/en/stable-2.3/playbooks_tests.html#testing-paths

@chfw
Copy link
Member

chfw commented Jun 11, 2018

please wait for next release

@chfw chfw closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants