Skip to content

Instantly share code, notes, and snippets.

@rhrn
Created March 14, 2019 21:05
Show Gist options
  • Save rhrn/b6d025ab766915f7349ee41e7946aa02 to your computer and use it in GitHub Desktop.
Save rhrn/b6d025ab766915f7349ee41e7946aa02 to your computer and use it in GitHub Desktop.
Jumphost / Bastion : ssh, ansible examples
# ansible hosts
all:
children:
project-servers:
hosts:
ingress:
ansible_user: ubuntu
ansible_host: 192.168.9.12 # replace by internal ip
app:
ansible_user: ubuntu
ansible_host: 192.168.20.92 # replace by internal ip
storage:
ansible_user: ubuntu
ansible_host: 192.168.18.165 # replace by internal ip
vars:
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o ProxyCommand="ssh -W %h:%p -q root@xxx.xxx.xxx.xxx"' # replace by user and ip
# peeped https://blog.keyboardinterrupt.com/ansible-jumphost/
Host project-servers-*
StrictHostKeyChecking no
User ubuntu
ProxyCommand ssh -W %h:%p -q root@xxx.xxx.xxx.xxx # replace by user and ip
Host project-servers-ingress
HostName 192.168.9.12 # replace by internal ip
Host project-servers-app
HostName 192.168.20.92 # replace by internal ip
Host project-servers-storage
HostName 192.168.18.165 # replace by internal ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment