How to retrieve a value from Airflow XCom pushed via SSHExecuteOperator
insted of xcom_push=True , try do_xcom_push=True, It will bring all the stdout to the xcom with key return_value
So the solution I have found is when task1 executes the shell script, you have to make sure the parameter you want to be captured by the XCom variable is the last thing printed by your script (using echo).
Then I was able to retrieve the XCom variable value with the following code snippet:
{{ task_instance.xcom_pull(task_ids='run_remote_sp_audit_batch_register') }}