SSH in shell command

11 views
Skip to first unread message

Sivaraman P

unread,
May 28, 2020, 11:53:44 AM5/28/20
to Ansible Project
I am new to ansible, i have the script in the remote machine and the script name is ssh.sh which contains below lines to ssh into some another server and run the script,

ssh @${server} "sh /tmp/script.sh"

the question is if i use shell module to call to the script ssh.sh in the playbook as below, will the ssh command with the above line will work or not???

- hosts: all
tasks:
- name: invoke the script
shell: sh ssh.sh
register: result

Stefan Hornburg (Racke)

unread,
May 28, 2020, 1:45:27 PM5/28/20
to ansible...@googlegroups.com
So what's the purpose of this task and why do you need Ansible for it?

Regards
Racke

--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc
Reply all
Reply to author
Forward
0 new messages