A Ansible LAB with SSH bastion host (jump).
Name | Public IP | Private IP |
---|---|---|
jump | DHCP | 172.1.1.10 |
server1 | Null | 172.1.1.11 |
SSH:
- Workstion --> jump: OK
- Workstion --> jump --> server1: OK
- Workstion --> server1: No.
Normal ping (not via Ansible):
- Workstion --> jump / Public IP: OK.
- Workstion --> jump / Private IP: No.
- Workstion --> server1 / Private IP: No.
- Vagrant
- Make
$ cat group_vars/all.yml
---
# vars file for ssh-bastion.ansible
ssh_remote_user: vagrant
ssh_bastion_private_key: ".vagrant/machines/jump/virtualbox/private_key"
ssh_server1_private_key: ".vagrant/machines/server1/virtualbox/private_key"
ssh_control_persist: 5m
ssh_strict_host_key_checking: "no"
None.
-
Boot the bastion and managed node.
# $ vagrant up $ make up
-
Run
setup_control_machine.yml
playbook at local.# $ ansible-playbook setup_control_machine.yml $ make init
-
Run
ping_all.yml
playbook.# $ ansible-playbook ping_all.yml $ make ping
MIT