I want to copy my python script which depends on my other python packages to remote node and run this scripts, is it possible?

35 views
Skip to first unread message

Justin Ren

unread,
Aug 16, 2017, 9:27:14 PM8/16/17
to Ansible Project
Hi all, 
I'm new user for ansible, I want to it's possible?
Or it's only possible for module, but it not possible for normal script under files folder?

Thanks,
Justin

Soniya panwar

unread,
Sep 6, 2017, 3:40:33 AM9/6/17
to Ansible Project
yes, you can copy your script and other packages to remote nodes and run this script.

>>I want to copy my python script which depends on my other python packages to remote node and run this scripts

>>I want to copy my python script which depends on my other python packages to remote node
You can perform this task by using copy module

- name:  copy python script  

  copy:

    src: <script.sh>

    dest: </usr/local/sbin/script.sh>

    owner: root

    group: root

    mode:  0755


And then you can also transfer your packages or you can install them if you don have any.
After this you can run your script by using command or shell module.
Reply all
Reply to author
Forward
0 new messages