--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/db9e47cf-a72f-415f-8474-16265c7eb0ccn%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/db9e47cf-a72f-415f-8474-16265c7eb0ccn%40googlegroups.com.
path: /tmp/"{{ now(fmt="%Y_%m_%d_%H_%M_%S.txt") }}"
path: /tmp/{{ now(fmt="%Y_%m_%d_%H_%M_%S.txt") }}
cool I see thank you! but how do you avoid the special characters in the file name? like so.
' "2023_07_26_14_34_22.txt" '
---
- name: date format filename
hosts: localhost
gather_facts: 0
tasks:
- name: create my file
ansible.builtin.file:
path: /tmp/"{{ now(fmt="%Y_%m_%d_%H_%M_%S.txt") }}"
state: touch
...
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b02458dc-f4f3-4063-9785-87f9728ce167n%40googlegroups.com.
-- Todd