Skip to main content

Easy creating LXD containers with included routine.

Project description

Lazy LXD

A tool for easy creating LXD containers.

Installing OpenSSH right from the script, for accessing into container thru SSH. And running Ansible playbooks over container.

Also have Russian language version of README

Requirements

  • Python >= 3.6
  • LXD
  • Ansible (Optionally). If you wish to run playbooks over created container.

Install

Just use the packet manager pip.

pip install lazy-lxd

Requirements

LXD

LXD need to be.

How to install:

apt:

$ apt install lxd lxd-client

snap:

$ snap install lxd

For centos use following article. Or use snap way.

For more information see official guide.

Ansible

If you want to run Ansible playbooks over container, you should have installed Ansible.

Python way:

$ pip install ansible

Usage

Help:

$ lazy-lxd --help

Simple container with default OS/version (Ubuntu/18.04):

$ lazy-lxd

Examples

Container with given name and OS/version is Centos 6:

$ lazy-lxd --name centos-container --os centos --release 6

Container with OS/version is Ubuntu 20.04 and with your path to Ansible playbooks:

$ lazy-lxd --os ubuntu --release 20.04 --playbooks-path $HOME/ansible/playbooks

Container with given name, default OS/version and exists SSH keys:

$ lazy-lxd --name ubuntu-focal --ssh-key-private $HOME/.ssh/id_rsa --ssh-key-public $HOME/.ssh/id_rsa.pub

Why script?

Why not to user utilities from CLI?

Needs to remember arguments of lxc, check that the container name is free, set OpenSSH into container every time, create keys manually, doing requests by container IP. All that this in one wrapper as script.

Run Ansible playbooks from script as bonus.

Why LXD?

In my opinion, LXD is better as container with OS for experiments, than Docker. It stateful, shouldn't think about data if container went down.

Docker is better choice for one service per container. But for OS experiments LXD is better.

License

This project uses the following license: MIT

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

lazy-lxd-1.1.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

lazy_lxd-1.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file lazy-lxd-1.1.0.tar.gz.

File metadata

  • Download URL: lazy-lxd-1.1.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for lazy-lxd-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b1aff7a877bd1b3aa0e8cebdeaedb51adddbd2c661e2fc8d956c21e9f22a09ee
MD5 e572de1eca9cc2f0f4fe1dbb2db39519
BLAKE2b-256 d4ebbc6c85bafefdae083f3737c94dd53f079be82122a2b1248bc1b313f561b2

See more details on using hashes here.

File details

Details for the file lazy_lxd-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: lazy_lxd-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for lazy_lxd-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e72b440b59e2c2aa6b12f637bca87d47432682e6e77945ff66052cf4cd2b6f8
MD5 c0786e96a27bc2418c9c9f05906326a5
BLAKE2b-256 1a046ff58e7184e25ece3dae95ccb209432db6da79e3d54f4e0ace295b437e05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page