Re: [ansible-project] conditional variables depending on time

2019-03-29 Thread olyx11
I figured it out by using set_fact and when for the conditionals. Thanks for the reply. > On Mar 29, 2019, at 1:03 PM, Kai Stian Olstad > wrote: > >> On 28.03.2019 21:17, James Gibson wrote: >> I am trying to output what shift an event has happened depending on the >> time of day, but keep

Re: [ansible-project] conditional variables depending on time

2019-03-29 Thread Kai Stian Olstad
On 28.03.2019 21:17, James Gibson wrote: > I am trying to output what shift an event has happened depending on the > time of day, but keep running into errors or getting nothing back. > > > --- > - hosts: localhost >vars: > shift: "{{ 'First Shift' if ansible_date_time.time >

[ansible-project] conditional variables depending on time

2019-03-28 Thread James Gibson
I am trying to output what shift an event has happened depending on the time of day, but keep running into errors or getting nothing back. --- - hosts: localhost vars: shift: "{{ 'First Shift' if ansible_date_time.time > '09:00:00' && ansible_date_time.time < '17:00:01' else '' }}"