chaining ssh and lxd connections

152 views
Skip to first unread message

Pavel Stratil

unread,
Jun 29, 2016, 4:33:05 PM6/29/16
to Ansible Project

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

Paul Tötterman

unread,
Jun 30, 2016, 3:46:02 AM6/30/16
to Ansible Project

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 

Pavel Stratil

unread,
Jun 30, 2016, 6:18:16 PM6/30/16
to Ansible Project
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.


Reply all
Reply to author
Forward
0 new messages