chaining ssh and lxd connections

Hi,

I wonder if/how is it possible to chain ssh and lxd connections in order to manipulate lxd/docker containers on remote physical servers

thanks, Pavel

I wonder if/how is it possible to chain ssh and lxd connections in order to manipulate lxd/docker containers on remote physical servers

Are the lxd or docker containers reachable by SSH? Are the addresses routable to your ansible control host? Just use SSH.

If not routable, but are running SSH, you can probably use ProxyCommand in ssh_config. e.g. ProxyCommand ssh -W %h:%p

Cheers,
Paul

yep, proxycommand came to my mind as well. still i’d love to keep the containers as simple as possible (without sshd running) and just connect to them via their connector, only not on local, but rather the remote host, so that i could define my inventory file along the lines of i.e.

localhost ansible_host=127.0.0.1 ansible_connection=local ansible_user=localuser
google ansible_host=8.8.8.8 ansible_connection=ssh ansible_user=remoteuser
bind@google ansible_connection=lxd # this tells to connect to google via its (ssh) connector and then to continue to connect to bind@google via lxd.

so basically, i’m looking if ansible can do piping/pxoxying connectors/connections.