Skip to content

opekar/pyinfra-connector-lxcssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyinfra-connector-lxcssh

pyinfra connector for executing commands inside LXC (not lxd) containers using SSH to host. Containers can be managed by root (sudo needed) or other users. Inside the container execution is always as a root only.

Instalation

Usage

An inventory file (inventory.py) for connection to lxc container via lxc (not lxd):

    hosts = [
        ("lxcssh/host_lxc:container_name"),
    ]

pyinfra inventory.py deploy.py

    hosts = [
        ("lxcssh/host_lxc:container_name", {"more ssh params here, or sudo relateing params"}),
    ]

Another possibility:

In this case we know that the container is manager by root user (even thought the container itself can be unpriviledged)

    pyinfra  @lxcssh/lxc_host.company.example:container --sudo  exec -- lsb_release -a

Thanks

Refs

About

Pyinfra connector to access lxc containes via ssh to host

Topics

Resources

License

Stars

Watchers

Forks

Languages