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
This commit is contained in:
parent
ce0a38ab48
commit
034d73a4bd
@ -167,7 +167,12 @@ class CallbackModule(CallbackBase):
|
|||||||
|
|
||||||
# Create the playbook
|
# Create the playbook
|
||||||
self.playbook = self.client.post(
|
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
|
# Record the playbook file
|
||||||
@ -193,7 +198,12 @@ class CallbackModule(CallbackBase):
|
|||||||
|
|
||||||
# Create the play
|
# Create the play
|
||||||
self.play = self.client.post(
|
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
|
# Record all the hosts involved in the play
|
||||||
@ -229,6 +239,7 @@ class CallbackModule(CallbackBase):
|
|||||||
tags=task.tags,
|
tags=task.tags,
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
handler=handler,
|
handler=handler,
|
||||||
|
started=datetime.datetime.now().isoformat(),
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.task
|
return self.task
|
||||||
|
Loading…
Reference in New Issue
Block a user