You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
442 B
16 lines
442 B
- name: collect facts if datetime is undefined
|
|
setup:
|
|
gather_subset:
|
|
- min
|
|
when: ansible_date_time is not defined
|
|
|
|
|
|
- name: set default datetime
|
|
set_fact:
|
|
current_date_time: "{{ ansible_date_time }}"
|
|
|
|
|
|
- name: format date
|
|
set_fact:
|
|
current_date_time: "{{ ansible_date_time.year ~ ansible_date_time.month ~ ansible_date_time.day }}"
|
|
when: (format is defined) and (format is string) and (format | upper == 'YYMMDD')
|
|
|