SSH Forwarding for Ansible

Contents

Resources

Ansible environment variables to forward SSH info through bastion

# When using ssh-agent need to forward SSH settings for Bastion machine
export ANSIBLE_TRANSPORT="ssh"
export ANSIBLE_SSH_ARGS="-o ForwardAgent=yes"

SSH Config settings for Bastion proxy

Host abc*
    User jmorgan

Host abc
    Hostname abc-bastion.cloudapp.net

Host abc* !abc-bastion.cloudapp.net
    ProxyCommand ssh abc -W %h:%p

Automatically setup ssh-agent as part of bash session

comments powered by Disqus