From 0cda450e57484550b98b35114febfb9d4e6eb7fc Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Tue, 16 Feb 2016 10:53:34 +0100 Subject: [PATCH] Add README.md file --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..227be29 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# ansible-lxc-ssh +Ansible connection plugin using ssh + lxc-attach + +## Description + +This plugin allows to use Ansible on a remote server hosting LXC containers, +without having to install SSH servers in each LXC container. + +The plugin connects to the host using SSH, then uses `lxc-attach` to enter the +container. This means the SSH connection must login as `root`, otherwise +`lxc-attach` will fail. + +## Configuration + +Add to `ansible.cfg`: +``` +[defaults] +connection_plugins = /path/to/connection_plugins/lxc_ssh +``` + +Then, modify your `hosts` file to use the `lxc_ssh` transport: +``` +container ansible_host=server ansible_connection=lxc_ssh ansible_ssh_extra_args=container +``` + +## notes + +* I haven't found any proper method to access the 'inventory_name' from the connection plugin, so I used 'ansible_ssh_extra_args' to store the name of the container. +