diff --git a/toolbox/_common.py b/toolbox/_common.py index ec222c6481..ec846c09fc 100644 --- a/toolbox/_common.py +++ b/toolbox/_common.py @@ -171,7 +171,10 @@ def _run(self): print(f"Using '{env['ANSIBLE_JSON_TO_LOGFILE']}' as ansible json log file.") # the play file must be in the directory where the 'roles' are - tmp_play_file = tempfile.NamedTemporaryFile("w+", dir=os.getcwd(), delete=False) + tmp_play_file = tempfile.NamedTemporaryFile("w+", + prefix="tmp_play_{}_".format(artifact_extra_logs_dir.name), + suffix=".yaml", + dir=os.getcwd(), delete=False) generated_play = [ dict(name=f"Run {self.role_name} role", connection="local",