Skip to content

Ansible connection backend to manage remote LXC containers

License

Notifications You must be signed in to change notification settings

hsz-devops/Gu1--ansible-lxc-remote

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-lxc-remote

Connection backend to manage remote LXC containers by ssh'ing into the host machine and using lxc-attach to get a shell on the container.

It allows ansible to manage LXC containers without having to run a publicly accessible ssh daemon on every single one of them, with all the hassle it causes (having to assign a public ipv4 on each container or having to do port forwarding for each containers's ssh daemon on the host, or having ipv6 assigned to each container but requiring ipv6 to access them...).

How to Install

In your ansible.cfg, add the following line:

connection_plugins = path/to/the/ansible-lxc-remote/directory/

How to use

In your inventory, just put:

container_name ansible_ssh_user=user ansible_ssh_host=127.0.0.1 ansible_ssh_port=22 ansible_connection=lxc_remote

Then you can run commands on your containers as you would with any other machine. It should even support su/sudo (on the LXC host).

About

Ansible connection backend to manage remote LXC containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%