Hi,
sorry for the confusing precendence of my latter message, but seems that
this message had some problems with gmane, so i'm resending it....
>> I thought the more generic "nesting" would be a good thing, because
>> the next guy might want to control Docker instances or Containers on
>> a remote host without them having a public IP. Maybe I'll try to
>> write a connection plugin.
> The way connection plugins work, it's not going to be possible to nest
> existing ones.
> But what you can do is, create a new API for "connection plugin
> layers" that can be put on top of an existing "base" connection
> plugin.
> Something like:
> class ConnectionLayer(object):
> def __init__(self, target_address):
> """target_address is a part of ansible_ssh_host for this
> plugin, like jail's path"""
> def wrap_command(self, command):
> """Wraps the command in chroot/jail/etc."""
> def unwrap_result(self, rc, stdout, stderr):
> """Takes whatever the wrapped command returned after being run
> by the base connection plugin,
> and returns a new tuple of (rc, stdout, stderr)"""
> def wrap_path(self, path):
> """Takes a path inside container/chroot/jail and translates it
> into host path."""
any update on this? I would like to use nsenter [1]_ to run commands
inside the container (how to transfer files is a detail i have yet to
analyze) to work on docker containers either locally or on a remote
host, and i would really like to contribute to and use a layer like
this. Unfortunately i'm quite new to ansible and not all the details
involving connections are clear to me.
> I would actually like to see something like this, as I've written a
> OpenVZ-over-SSH connection plugin at work (and I can already give you
> a hint: don't try to put host address anywhere but ansible_ssh_host,
> this variable gets special treatment. I've tried to have separate
> ansible_vzenter_ctid, and in the end had to rewrite that part).
Nice! openvz is the other virtualization system i use
So, where you store the ctid? in to so other host related variable? Can
you say more about having something like a variable ansible_vzenter_ctid
is not feasible?
Cheers,
Alberto