From 034d73a4bd7e165dbce810c4cc1874a2bab77d70 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Thu, 19 Sep 2019 15:14:43 -0400 Subject: [PATCH] callback: provide the starting dates for playbooks, plays and tasks The started dates would previously default to "now" but it turns out that the "now" for the server and the "now" for the ended date that the callback provides later can be in different time zones. Change-Id: Ibd48625742cbc4d8a5f4bdbbb389d0c7c4df5a66 --- ara/plugins/callback/ara_default.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ara/plugins/callback/ara_default.py b/ara/plugins/callback/ara_default.py index 6b108036..346cc724 100644 --- a/ara/plugins/callback/ara_default.py +++ b/ara/plugins/callback/ara_default.py @@ -167,7 +167,12 @@ class CallbackModule(CallbackBase): # Create the playbook self.playbook = self.client.post( - "/api/v1/playbooks", ansible_version=ansible_version, arguments=cli_options, status="running", path=path + "/api/v1/playbooks", + ansible_version=ansible_version, + arguments=cli_options, + status="running", + path=path, + started=datetime.datetime.now().isoformat(), ) # Record the playbook file @@ -193,7 +198,12 @@ class CallbackModule(CallbackBase): # Create the play self.play = self.client.post( - "/api/v1/plays", name=play.name, status="running", uuid=play._uuid, playbook=self.playbook["id"] + "/api/v1/plays", + name=play.name, + status="running", + uuid=play._uuid, + playbook=self.playbook["id"], + started=datetime.datetime.now().isoformat(), ) # Record all the hosts involved in the play @@ -229,6 +239,7 @@ class CallbackModule(CallbackBase): tags=task.tags, lineno=lineno, handler=handler, + started=datetime.datetime.now().isoformat(), ) return self.task