Hey
There are a few ways to do this, they usually revolve around using filters
to "filter" the value into something else. Ansible has a few filters
available outside of the standard Jinja2 functions which can be found here
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html.
In your case you want to use the splitext to split the path between the
path/filename and the extension like so;
src: C:\Temp\{{ (script_filename.Name|splitext)[0] }}
What we do here is pass the value of script_filename.Name to the filter
splitext and that ultimately returns a value, in this case returns a tuple
of (path without extension, extension). We don't want the extension so we
only get the first element from the return value and because it is a 0
based index, 0 is the first element.
Thanks
Jordan
--
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/b9e57c64-ffcc-4e9b-b68c-08b839f4a687%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.