On Saturday, 5 January 2019 22:28:19 CET John Simmons wrote:
> I'm trying to send a ISO8601 time format string to the Prometheus alert 
> manager through the uri moule to tell it to silence an alarm for the next 
> hour.
> 
> I have worked out that the current time is available 
> (ansible_date_time.iso8601) but how can i create a fact that is current 
> ISO8601 time add 45 minutes or 1 hour for example? for when the end of the 
> silence should be?
> 
> Many thanks in advance (hoping this is possible)

The easiest is to just use the date command

{{ lookup('pipe', 'date --iso-8601=seconds --utc --date="+45 minutes"') }}
{{ lookup('pipe', 'date --iso-8601=seconds --utc --date="+1 hour"') }}


-- 
Kai Stian Olstad


-- 
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/10461187.yxmQOdv8K5%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to