Am using the ansible_date_time.hour
and ansible_date_time.minute
in one of my playbooks.
But I need to add time on to these facts (or in a variable).. i.e. if ansible_date_time.hour
returns 16 - I want to add a couple of hours, or if ansible_date_time.minute
returns 40 - I want it to be 50..
Of course there is a ceiling of 23 and 59 for the hours and mins... as I thought about registering a variable from:
- name: Register HH
shell: date '+%H'
register: HP_HH
- debug: msg="{{ HP_HH.stdout | int + 3 }}"
But obviously if my playbook runs at after 21:00 I am out of luck.
Does anyone have a suggestion or workaround?