smnag
smnag

Reputation: 51

Print real time script output running on remote in ansible

I am running a bash script from the playbook. The bash script runs multiple scripts in parallel in-turn on a remote machine and it will give the output on console only when the entire playbook is executed. I want to print the output real-time. Is it possible?

Storing of result with 'register' provided by ansible to print output is not helping here. As I need real-time output.

Upvotes: 2

Views: 2718

Answers (1)

CrommCruach
CrommCruach

Reputation: 91

It is not possible to take influence on a script "realtime" that is currently running.

U could use the failed_when to catch script errors: https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#controlling-what-defines-failure

or u catch errors in the script self at runtime.

Upvotes: 1

Related Questions