local or remote execution

Hi,

I have ansible task

  • shell: “python task.py”
    register: result
    until: result.stdout.find(“in-progress”)==-1
    retries: 7
    delay: 20

python module executed remotely on target host.

Where is executed verification on string “in-progress” ? locally where playbook code executed or remotely?
If it is executed remotely “ssh” connection will be allocated during whole execution…

Thanks,
Dmitriy

It depends on how your hosts is defined st the play level.

Assuming your play is targeting a remote host then your task will be running on the remote host.

If you need to run some task locally while the rest of the tasks remotely you can use delegate_to: localhost on that one task.

Regards
Tony

Hi, I figured out.
Comparison happened locally,-vvvvv option shows that after every python execution ssh connection dropped

Thanks,
Dmitriy