Use custom "ssh" command ?

74 views
Skip to first unread message

Florent B

unread,
Mar 10, 2016, 6:34:25 AM3/10/16
to Ansible Project
Hi,

I would like my Ansible to use "autossh" command instead of "ssh" to
connect to hosts in inventory.

Is there a way to do this ?

Thank you.

Rahul Patil

unread,
Mar 10, 2016, 7:00:08 AM3/10/16
to Ansible Project
Hi Florent,

I don't have tried this but you can try, ssh command has been defined in `site-packages/ansible/runner/connection_plugins/ssh.py`

````
ssh_cmd += ["ssh", "-C"]
````

If autossh accept the same argument as ssh then it will work.

Best Regards,
Rahul Patil

Florent B

unread,
Mar 10, 2016, 7:27:11 AM3/10/16
to ansible...@googlegroups.com
Hi,

Thank you, I saw that "ssh" was written in source without having ability configuring it.

I saw I could set a "retries" option in ansible.cfg, that's a cleaner solution than changing source. I will see...
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7e30fa2d-dd48-454b-8c44-41297ec8dc0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Florent B

unread,
Mar 10, 2016, 7:36:14 AM3/10/16
to ansible...@googlegroups.com
Do you know in which contexts are executed python commands like this ssh one ? This is to determine if I could use the "alias" in Bash for example...


On 03/10/2016 01:00 PM, Rahul Patil wrote:
--
Reply all
Reply to author
Forward
0 new messages