Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
allow for ssh-specific arguments #6238
scp and scp are not necessarily argument compatible. For example, the -R switch (which allows you to create a reverse tunnel) is usable on SSH only and not SCP. I am trying to use this in an ansible script but unfortunately there is no configuration option to pass arguments to just the ssh command and not scp/sftp.
This code allows you to specify commands that will only be passed to ssh via ssh_specific_args in ansible.cfg.
Are you actually passing -R with ansible? I'm not sure that entirely makes sense with Ansible's calling architecture and perhaps is something that should be done explicitly instead?
Basically I'm wanting to understand more about the underlying use case prior to adding this.
I am using the -R flag successfully now with this change. My use case is this: I have hosts which have extremely limited internet access; they have 443 forwarded via a proxy on the frontend, and I can SSH to them. That's about it and it is not under my control. Unfortunately, I need to do things like pull code off github, download packages and various other internet related tasks.
The way I have solved this is to run tinyproxy locally on my machine, and forward a port back to it using SSH arguments. Then, simply by adding an extra environment attribute to a task, I can selectively give tasks access to the internet for things like wget. For example:
I have just used this over the weekend to do a bunch of deploying and I have not encountered any problems.