execute Ansible task with Teleport (K8s deployment) using Tunnel for connection #6462
pankajpandey9
started this conversation in
General
Replies: 1 comment 7 replies
-
You should be able to do this with a custom In the configs below:
$ ssh-add -l
2048 SHA256:oHxI4xZcGS6SsHLl7G9UMnSAZR9Cr4Qc8T7axe8FjhE teleport:teleportusername (RSA-CERT)
2048 SHA256:oHxI4xZcGS6SsHLl7G9UMnSAZR9Cr4Qc8T7axe8FjhE teleport:teleportusername (RSA)
Host iot-node
ProxyCommand ssh -F ./ssh.cfg -p 3023 [email protected] -s proxy:%h:%p
Port 3022
User nodeuser
UserKnownHostsFile ./ssh_known_hosts
Host teleport.example.com
Port 3023
User proxyuser
ControlMaster auto
ControlPath ~/.ssh/ansible-%r@%h:%p
ControlPersist 5m
UserKnownHostsFile ./ssh_known_hosts
[ssh_connection]
ssh_args = -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=5m -o UserKnownHostsFile=./ssh_known_hosts
control_path = ~/.ssh/ansible-%%r@%%h:%%p
scp_if_ssh = True At this point you should be able to run
|
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I have Teleport Cluster deployed on Kubernetes and I need to execute Ansible tasks to other VMs using Teleport tunnel.
Since I am using tunnel for Node to Proxy (port 443). Which has no 3022 port open on the host (so cant specify the port in ssh config / Ansible config) files
And if I use proxy port as 3025 for node addition then the node is adds sucessfully. However, cant connect via UI or tsh and throws error "dialing directly: dial tcp 10.x.x.0:3022: connect: connection refused". where the IP address is from Kubernetes Cluster and does not belong to the node / proxy / auth
Please advise... Thanks
Beta Was this translation helpful? Give feedback.
All reactions