Skip to content

Commit 0cda450

Browse files
committed
Add README.md file
1 parent 3401676 commit 0cda450

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ansible-lxc-ssh
2+
Ansible connection plugin using ssh + lxc-attach
3+
4+
## Description
5+
6+
This plugin allows to use Ansible on a remote server hosting LXC containers,
7+
without having to install SSH servers in each LXC container.
8+
9+
The plugin connects to the host using SSH, then uses `lxc-attach` to enter the
10+
container. This means the SSH connection must login as `root`, otherwise
11+
`lxc-attach` will fail.
12+
13+
## Configuration
14+
15+
Add to `ansible.cfg`:
16+
```
17+
[defaults]
18+
connection_plugins = /path/to/connection_plugins/lxc_ssh
19+
```
20+
21+
Then, modify your `hosts` file to use the `lxc_ssh` transport:
22+
```
23+
container ansible_host=server ansible_connection=lxc_ssh ansible_ssh_extra_args=container
24+
```
25+
26+
## notes
27+
28+
* 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.
29+

0 commit comments

Comments
 (0)