apenella/go-ansible

Inquiry about Referencing Executed Processes in DefaultExecute Object

chungeun-choi opened this issue · 2 comments

Hello,

I have a question regarding the DefaultExecute object. Is there a property that allows us to reference the process that has been executed? We are looking for a variable that can track the Ansible tasks executed to ensure they are properly monitored.

Thank you.

hi @chungeun-choi!
Thank you for your question. Unfortunately, at this moment, it is not possible to grab the ID of the spawned process. The Cmd is instantiated inside the Execute method of the DefaultExecutor and is not accessible from outside.

One solution that comes to mind is to create an Executor inspired by DefaultExecutor, where you can have more control over the Cmd.

I will consider if it is possible to achieve this while maintaining an agnostic Executable within the DefaultExecutor.

Hi @apenella ,
Thank you for your response. I will proceed with developing a custom Executor object.