Skip to content

Instantly share code, notes, and snippets.

---
- name: date and time demo
hosts: localhost
connection: local
gather_facts: true
tasks:
- name: time of day
vars:
afternoon: 'afternoon'
morning: "{{ 'morning' if ansible_date_time.hour < '12' else afternoon }}"