Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Mic92/ansible-lxc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ansible-lxc

This plugin is part now of ansible 2.1 (see)

Ansible Connection Plugin to deploy to local lxc containers (https://linuxcontainers.org/)

This version requires at least ansible 2.0. If you want to use ansible with older versions checkout v1.0

INSTALL

$ mkdir -p /etc/ansible/connection_plugins/
$ git clone git@github.com:Mic92/ansible-lxc.git /etc/ansible/connection_plugins/lxc

If your ansible code is already managed by git, you might want to add a submodule instead:

$ mkdir -p /etc/ansible/connection_plugins/
$ git submodule add git@github.com:Mic92/ansible-lxc.git /etc/ansible/connection_plugins/lxc
  • Then add lxc directory to plugin search path in ansible.cfg:
connection_plugins = /usr/share/ansible_plugins/connection_plugins:/etc/ansible/connection_plugins/lxc

USAGE

In your hosts file on the server running lxc use the lxc container name (examplecontainer in this case) as hostname and set ansible_connection to lxc:

examplecontainer ansible_connection=lxc