[ansible]Ansible with bastian host
How to run ansible commands with servers behind bastian-host Create ssh custom config file ssh.config
Host bastion HostName bastian_server_ip User my_user ProxyCommand none IdentityFile ~/.ssh/id_rsa BatchMode yes PasswordAuthentication no Host * ServerAliveInterval 60 TCPKeepAlive yes ProxyCommand ssh -q -A my_user@bastian_server_ip nc %h %p ControlPath ~/.ssh/mux-%r@%h:%p User my_user ControlMaster auto now we can connect to host behind bastian host with this command :
ssh -F ssh.config host_private_ip Create ansible custom config file ansible.