Florian Haas
2015-Mar-13 08:47 UTC
[libvirt-users] lxc-enter-namespace support in Python API
Hello everyone, referring back to https://www.redhat.com/archives/libvirt-users/2013-August/msg00107.html, in which a user discovered that there is no equivalent to "virsh -c lxc:/// lxc-enter-namespace" in the Python API. Has that ever changed? In that thread Daniel suggested that the user file a bug, but that apparently never happened. Why am I interested in this? Ansible currently supports a somewhat limited libvirt_lxc connection driver which uses lxc-enter-namespace to access LXC containers without SSH (https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection_plugins/libvirt_lxc.py). That connection driver, written in Python like the rest of Ansible, currently has to use jump through subprocess hoops with virsh to enter the namespace, which is slow and doesn't support pipelining. Being able to use the native Python API would help greatly. In addition, if it were to use the Python API instead, the connection plugin could also be extended to use lxc+ssh:// connection types so Ansible users could potentially manage container hosts _and_ all their containers from a single playbook, just so long as they have SSH access to the host. Does anyone know whether that extension of the API is being / has been addressed? Cheers, Florian
Maybe Matching Threads
- lxc-enter-namespace support in Python API
- Re: lxc-enter-namespace error: security model cannot be entered.
- lxc-enter-namespace error: security model cannot be entered.
- C7 ansible 2.3 become_method: su not working
- How to automatically confirm importing repo key?