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 run
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 > '09:00:00'
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 '' }}"