Skip to main content

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

Release files for lazy-lxd 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazy-lxd 1.1.0
File Size Uploaded
lazy-lxd-1.1.0.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lazy-lxd 1.1.0
File Interpreter ABI Platform
lazy_lxd-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.2 kB

Release files / lazy-lxd-1.1.0.tar.gz

Download URL lazy-lxd-1.1.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b1aff7a877bd1b3aa0e8cebdeaedb51adddbd2c661e2fc8d956c21e9f22a09ee
BLAKE2b-256 checksum
How to use checksums
d4ebbc6c85bafefdae083f3737c94dd53f079be82122a2b1248bc1b313f561b2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / lazy_lxd-1.1.0-py3-none-any.whl

Download URL lazy_lxd-1.1.0-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e72b440b59e2c2aa6b12f637bca87d47432682e6e77945ff66052cf4cd2b6f8
BLAKE2b-256 checksum
How to use checksums
1a046ff58e7184e25ece3dae95ccb209432db6da79e3d54f4e0ace295b437e05
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page