definition of lxc containers using python
Project description
chibi_lxc
definition of lxc containers using python class and manage lxc similar to vagrant
Example
write a file with the container
from chibi_lxc import Container
class Centos_8( Container ):
name = 'centos_8'
distribution = 'centos'
arch = 'amd64'
version = '8'
provision_folders = { 'scripts': 'provision' }
env_vars = { 'LC_ALL': 'es_MX.utf8' }
scripts = ( 'install_python.sh', ( 'add_user.py', 'chibi', ) )
write a config.py
with the next conten
import sys
from chibi.config import configuration
from chibi.file import Chibi_path
from chibi.module import import_
sys.path.append( Chibi_path( '.' ).inflate )
from containers.base import Centos_7
configuration.chibi_lxc.containers.add( Centos_7 )
the scripts should be in the folder provision_folders[ ‘scripts’ ]
create the container
- ::
chibi_lxc up Centos_8 # create the container chibi_lxc provision Centos_8 # not needed the first time chibi_lxc list # lista los container configurados chibi_lxc status # lista el status de los container chibi_lxc host # lista el estado y hosts de los container chibi_lxc stop Centos_8 # stop the container chibi_lxc destroy Centos_8 # destroy the container
Free software: WTFPL
Documentation: https://chibi-lxc.readthedocs.io.
Features
create container
provision container
destroy container
History
0.0.1 (2020-04-05)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chibi_lxc-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4e4d7f46120a6b13c0d6465d602d704fd2eabbdb1b641d0381399b03ae61392 |
|
MD5 | 2a631e974b391d9e801501fb4b4b2706 |
|
BLAKE2b-256 | 4ea0f6eb3b889683c93a5032ba4c617d9168040578f958612f81c155d4c1add1 |