ansible-playbookで日付毎に新しいファイルパスを作成する場合はansible_date_time.dateを利用します。
但し、ansible_date_timeを利用する場合はgather_factをtrueにします。ただ日付を使うためにgather_factをtrueにするよりもgather_subsetを利用して日付だけを取得するようにします。
例:
- name: gather date and time only
setup:
gather_subset:
- "date_time"
when: ansible_date_time is not defined
- name: save result to local directory
copy:
content: "{{ result.stdout[1] | replace('show ip interface brief', '') | replace('\\n', '\n') }}"
dest: "/home/ozawa/outputs/show_ip_interface_brief/{{ ansible_date_time.date }}/{{ inventory_hostname }}.txt"
以上