docs: updates for #376 and #371

issue72
David Wilson 6 years ago
parent 6dddef0c45
commit f6b201bdfc

@ -155,6 +155,7 @@ Noteworthy Differences
* The `docker <https://docs.ansible.com/ansible/2.6/plugins/connection/docker.html>`_, * The `docker <https://docs.ansible.com/ansible/2.6/plugins/connection/docker.html>`_,
`jail <https://docs.ansible.com/ansible/2.6/plugins/connection/jail.html>`_, `jail <https://docs.ansible.com/ansible/2.6/plugins/connection/jail.html>`_,
`kubectl <https://docs.ansible.com/ansible/2.6/plugins/connection/kubectl.html>`_,
`local <https://docs.ansible.com/ansible/2.6/plugins/connection/local.html>`_, `local <https://docs.ansible.com/ansible/2.6/plugins/connection/local.html>`_,
`lxc <https://docs.ansible.com/ansible/2.6/plugins/connection/lxc.html>`_, `lxc <https://docs.ansible.com/ansible/2.6/plugins/connection/lxc.html>`_,
`lxd <https://docs.ansible.com/ansible/2.6/plugins/connection/lxd.html>`_, `lxd <https://docs.ansible.com/ansible/2.6/plugins/connection/lxd.html>`_,
@ -681,6 +682,8 @@ connection delegation is supported.
* ``ansible_user``: Name of user within the container to execute as. * ``ansible_user``: Name of user within the container to execute as.
.. _method-jail:
FreeBSD Jail FreeBSD Jail
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -692,6 +695,19 @@ connection delegation is supported.
* ``ansible_user``: Name of user within the jail to execute as. * ``ansible_user``: Name of user within the jail to execute as.
.. _method-kubectl:
Kubernetes Pod
~~~~~~~~~~~~~~
Like `kubectl
<https://docs.ansible.com/ansible/2.6/plugins/connection/kubectl.html>`_ except
connection delegation is supported.
* ``ansible_host``: Name of pod (default: inventory hostname).
* ``ansible_user``: Name of user to authenticate to API as.
Local Local
~~~~~ ~~~~~

@ -589,6 +589,26 @@ Router Class
Filename or complete path to the ``jexec`` binary. ``PATH`` will be Filename or complete path to the ``jexec`` binary. ``PATH`` will be
searched if given as a filename. Defaults to ``/usr/sbin/jexec``. searched if given as a filename. Defaults to ``/usr/sbin/jexec``.
.. method:: kubectl (pid=None, container=None, kubectl_path=None, username=None, \**kwargs)
Construct a context in a container via the Kubernetes ``kubectl``
program.
Accepts all parameters accepted by :meth:`local`, in addition to:
:param str pod:
Kubernetes pod to connect to.
:param str container:
Optional container within pod to connect to. If the pod has only
one container, this parameter is not required. Defaults to
:data:`None`.
:param str kubectl_path:
Filename or complete path to the ``kubectl`` binary. ``PATH`` will
be searched if given as a filename. Defaults to ``kubectl``.
:param str username:
Optional username to authenticate to the Kubernetes API server
with. within the container to :func:`setuid` to.
.. method:: lxc (container, lxc_attach_path=None, \**kwargs) .. method:: lxc (container, lxc_attach_path=None, \**kwargs)
Construct a context on the local machine within an LXC classic Construct a context on the local machine within an LXC classic

@ -41,6 +41,9 @@ Enhancements
`uri <http://docs.ansible.com/ansible/latest/modules/uri_module.html>`_). See `uri <http://docs.ansible.com/ansible/latest/modules/uri_module.html>`_). See
:ref:`ansible_tempfiles` for a complete description. :ref:`ansible_tempfiles` for a complete description.
* `#376 <https://github.com/dw/mitogen/pull/376>`_: the ``kubectl`` connection
type is now supported. Contributed by Yannig Perré.
* `084c0ac0 <https://github.com/dw/mitogen/commit/084c0ac0>`_: avoid a * `084c0ac0 <https://github.com/dw/mitogen/commit/084c0ac0>`_: avoid a
roundtrip in roundtrip in
`copy <http://docs.ansible.com/ansible/latest/modules/copy_module.html>`_ and `copy <http://docs.ansible.com/ansible/latest/modules/copy_module.html>`_ and
@ -170,6 +173,10 @@ Core Library
* `#345 <https://github.com/dw/mitogen/issues/345>`_: the SSH connection method * `#345 <https://github.com/dw/mitogen/issues/345>`_: the SSH connection method
allows optionally disabling ``IdentitiesOnly yes``. allows optionally disabling ``IdentitiesOnly yes``.
* `#371 <https://github.com/dw/mitogen/pull/371>`_: the LXC connection method
uses a more compatible method to establish an non-interactive session.
Contributed by Brian Candler.
* `af2ded66 <https://github.com/dw/mitogen/commit/af2ded66>`_: add * `af2ded66 <https://github.com/dw/mitogen/commit/af2ded66>`_: add
:func:`mitogen.fork.on_fork` to allow non-Mitogen managed process forks to :func:`mitogen.fork.on_fork` to allow non-Mitogen managed process forks to
clean up Mitogen resources in the child. clean up Mitogen resources in the child.
@ -191,6 +198,7 @@ the bug reports in this release contributed by
`Alex Russu <https://github.com/alexrussu>`_, `Alex Russu <https://github.com/alexrussu>`_,
`atoom <https://github.com/atoom>`_, `atoom <https://github.com/atoom>`_,
`Berend De Schouwer <https://github.com/berenddeschouwer>`_, `Berend De Schouwer <https://github.com/berenddeschouwer>`_,
`Brian Candler <https://github.com/candlerb>`_,
`Dan Quackenbush <https://github.com/danquack>`_, `Dan Quackenbush <https://github.com/danquack>`_,
`dsgnr <https://github.com/dsgnr>`_, `dsgnr <https://github.com/dsgnr>`_,
`Jesse London <https://github.com/jesteria>`_, `Jesse London <https://github.com/jesteria>`_,
@ -203,8 +211,9 @@ the bug reports in this release contributed by
`Pierre-Louis Bonicoli <https://github.com/jesteria>`_, `Pierre-Louis Bonicoli <https://github.com/jesteria>`_,
`Prateek Jain <https://github.com/prateekj201>`_, `Prateek Jain <https://github.com/prateekj201>`_,
`Rick Box <https://github.com/boxrick>`_, `Rick Box <https://github.com/boxrick>`_,
`Tawana Musewe <https://github.com/tbtmuse>`_, and `Tawana Musewe <https://github.com/tbtmuse>`_,
`Timo Beckers <https://github.com/ti-mo>`_. `Timo Beckers <https://github.com/ti-mo>`_, and
`Yannig Perré <https://github.com/yannig>`_.
v0.2.2 (2018-07-26) v0.2.2 (2018-07-26)

@ -48,13 +48,10 @@ class Stream(mitogen.parent.Stream):
'merge_stdio': True 'merge_stdio': True
} }
def construct(self, pod = None, container=None, def construct(self, pod, container=None, kubectl_path=None, username=None,
kubectl_path=None, username=None,
**kwargs): **kwargs):
assert pod
super(Stream, self).construct(**kwargs) super(Stream, self).construct(**kwargs)
if pod: self.pod = pod
self.pod = pod
if container: if container:
self.container = container self.container = container
if kubectl_path: if kubectl_path:

Loading…
Cancel
Save