Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Maybe I didn’t see something, but if ansible is involved, then playbook.yml may look like this:
---
- hosts: all
vars:
remote_path: "path/to/file/on/remote"
path_to_local_file: "local/file/yourfile.py"
tasks:
- name: remote path exists?
file:
path: "{{ remote_path }}"
state: directory
- name: copy your file in place.
copy:
src: "{{ path_to_local_file }}"
dest: "{{ remote_path }}/filename.py"
mode: 0755
- name: execute file
shell: >
python3 {{ remote_path }}/filename.py
changed_when: false
and he will run there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question