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.
17 lines
442 B
17 lines
442 B
2 years ago
|
- 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')
|