Is there a way to ssh to a server and run a PythonOperator with Airflow? I am looking something like SSHExecuteOperator but instead of executing a bash command execute a python callable.
-
1Where you able to solve this?Tsume– Tsume2018-07-27 13:06:55 +00:00Commented Jul 27, 2018 at 13:06
Add a comment
|
1 Answer
Its ssh privacy issue
- goto your host ssh server and run
ssh-keygen -t rsaand press enter all the way - You will get 2 rsa files.copy that file to airflow env and copy its full path
The Just add the below in your connection from the airflow UI
{"key_file": "/usr/local/airflow/.ssh/id_rsa.pub", "no_host_key_check": true}Recompile the DAG and run it