Open zoobab opened 6 years ago
The IdentityFile can even be hardcoded to IdentityFile ~/.ssh/id_rsa
, it works with the reference to HOME as ~.
So the only think that needs to be templated is the bastion-public_ip
.
I would also investigate to run/rewrite the shell scripts as ansible roles, and use this feature:
Hi @zoobab sounds great! If you want to go for it with a PR I'd love to take a look. I'd take a look myself but am slammed for the next couple of weeks.
I will make a branch with my changes, but I have a problem to run ansible as root on the bastion, as the keyforwarding does not seem to work for the root user, even with sudo -E .
I have made some notes here:
https://github.com/zoobab/terraform-aws-openshift/blob/master/sshjump.md
Will try to make a branch with a demo, but I need to find time as I am on the release-3.9 branch. I have to solve the sudo problem, probably by exporting the ssh-agent file between the ec2-user and root.
Hi,
I just make a simple sshconfig file from a template which uses the ProxyJump feature of SSH:
https://wiki.gentoo.org/wiki/SSH_jump_host
The hardcoded sshconfig file looks like this:
To ssh to the master, bastion, node1, node2:
To what I can figure out, the "ForwardAgent yes" seems to do the job to add automatically the key to the ssh-agent, which I found fragile right now.
The 2 items to template are the Hostname and the location of the SSH key.
What do you think?
Can I make a PR to template that dynamically and replace parts of the makefile?