I want to use Ansible to update some remove Ubuntu Servers with no internet access, I've downloaded a created a repo on the Ansible hosted by nginx http://localhost/media/apt
In order to the remote servers to get the repo, I've overwritten the sources.list to be:
deb http://127.0.0.1:88/media/apt trusty main
I've put in the ansible.cfg file:
[ssh_connection]
ssh_args = -R 88:127.0.0.1:80
For completeness here is my yml file:
- name: apt proxy configuration
copy:
src: sources.list
dest: /etc/apt/sources.list
- name: APT | ge repo key
apt_key:
data: "{{repository_key }}"
- name: Upgrade
apt:
update_cache: yes
allow_unauthenticated: yes
upgrade: dist
The script does the job it updates the sources file, installs the key and updates the remote system, which is fantastic.
However by interfering with the ssh_args, I've upset ansible with every task I now get two warnings: *
[WARNING]: sftp transfer mechanism failed on [192.168.128.129]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [192.168.128.129]. Use ANSIBLE_DEBUG=1 to see detailed information
I can see it's adding my ssh_args options into the sftp and scp transfers
SSH: EXEC sftp -b - -R 88:127.0.0.1:80 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 '[192.168.128.129]'
<192.168.128.129> SSH: EXEC sftp -b - -R 88:127.0.0.1:80 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 '[192.168.128.129]' [WARNING]: sftp transfer mechanism failed on [192.168.128.129]. Use ANSIBLE_DEBUG=1 to see detailed information
<192.168.128.129> SSH: EXEC scp -R 88:127.0.0.1:80 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 /tmp/tmp87UMuT '[192.168.128.129]:/root/.ansible/tmp/ansible-tmp-1509468784.12-45526153395602/setup.py' [WARNING]: scp transfer mechanism failed on [192.168.128.129]. Use ANSIBLE_DEBUG=1 to see detailed information
Is there a way I can connect to my remote machine with a reverse proxy in place without upsetting ansible scp and ftp connection?