Hi,
I’m developing a “custom ansible module” to start a long running background process on the remote host.
As per the response for the post https://github.com/ansible/ansible/issues/28264, Ansible connection stays
until all the processes are terminated.
And that matches with the ansible generated code below.
p = subprocess.Popen([‘/usr/bin/python’, module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
(stdout, stderr) = p.communicate(json_params)
p.communicate(json_params) waits until all the processes (including child) are terminated.i
is there a way to do this ? async or systemd is not an option since my custom module is going to invoke another python script which will start the process.
Thanks in advance!!!
Regards,
Senthil