Basename of {file} in ansible_managed

666 views
Skip to first unread message

stephan....@gmail.com

unread,
Aug 31, 2014, 10:05:24 AM8/31/14
to ansible...@googlegroups.com
Friends,

{file} in ansible_managed uses gets replaced with the filename and its full path. Is there another variable to get the filename only, omitting the full path?

Thanks!
Stephan

Michael DeHaan

unread,
Sep 2, 2014, 6:57:27 PM9/2/14
to ansible...@googlegroups.com
There's a rather limited set of variables sent to what is provided to the ansible_managed as it's not evaluated by the template engine, but some basic string.format operations.

Jinja2 *does* have a basename filter, though this line is not evaluated by Jinja2, so changing this would require the code to itself change, and also some code to keep compatibility.

As such, this is unlikely to change at this time.




--
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/ee3d03b6-bf30-4697-a410-a8f08fa9d999%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages