Ansible Bastion – How to run playbook on remote hosts using Bastion

Ansible Bastion – How to run playbook on remote hosts using Bastion

No alt text provided for this image

In General, We know it is a an easy job to connect to remote hosts from Ansible control machine ( where you execute ansible playbook) because it is agent less

But in industry we do not directly connect from our laptop (mac/windows) to the servers. For security reasons, we will first login to the Jump Server also known as?Bastion host.

With SSH Forwarding mechanism it is possible you can login to the remote server directly by using the Bastion as a tunnel and this process is technically known as?SSH Forwarding.

We can do this process in SSH using ProxyCommand

ProxyCommand (Forwarding stdin and stdout)

The ProxyCommand itself is a specific command used to connect to a remote server

No alt text provided for this image

Now using SSH Forwarding technique we run Ansible playbook on a remote host by using the Bastion as a tunnel

Write same SSH ProxyCommand in ansible inventory

No alt text provided for this image

要查看或添加评论,请登录

社区洞察

其他会员也浏览了