On Tuesday, February 13, 2018 at 7:25:24 AM UTC-5, mail.ph...@gmail.com 
wrote:
>
>
> How should I split this dest: statement into multiple lines ?
>
>     - copy:
>         content: "{{ config.stdout[0] }}"
>         *dest: "{{ backup_root }}/{{ inventory_hostname }}/dhcp_leases_{{ 
> ansible_date_time.year }}{{ ansible_date_time.month }}{{ 
> ansible_date_time.day }}{{ ansible_date_time.hour }}{{ 
> ansible_date_time.minute }}{{ ansible_date_time.second }}"*
>

There are multiple ways to do it, but I'd go for something like this:
dest: "{{ [ backup_root, inventory_hostname, 'dhcp_leases_' ~
          ('%Y%m%d%H%M%S' | strftime) ] | join('/') }}"

(If using the time from the facts is important, you can do 
"strftime(ansible_date_time.epoch)" instead of the plain invocation.)

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80449d9d-463f-4436-8ab5-a3dac2d6aa89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to