From b17b5ad85bddc2e80273f2f91f39987e28c28ed3 Mon Sep 17 00:00:00 2001 From: Jonathan Mainguy Date: Mon, 24 Mar 2014 13:43:00 -0400 Subject: [PATCH] Added ansible_date_time.weekday as a fact. This returns Monday,Tuesday,Wednesday,Thursday,Friday,Saturday, or Sunday depending on the remote servers time. Useful for backups the way I use it --- lib/ansible/module_utils/facts.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 01f812def7b..4ed366d4ccd 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -416,6 +416,7 @@ class Facts(object): now = datetime.datetime.now() self.facts['date_time']['year'] = now.strftime('%Y') self.facts['date_time']['month'] = now.strftime('%m') + self.facts['date_time']['weekday'] = now.strftime('%A') self.facts['date_time']['day'] = now.strftime('%d') self.facts['date_time']['hour'] = now.strftime('%H') self.facts['date_time']['minute'] = now.strftime('%M')