Introduction
Butterknife command-line utility can be used to serve snapshots via HTTP; send and receive snapshots over SSH and multicast; list local and remote snapshots.
Installation
Install dependencies:
sudo apt-get install lxc python3-dev cython3 python3-pip pigz btrfs-progs
sudo apt-get install python3-lxc # Ubuntu 14.04 or older
sudo pip3 install jinja2 click falcon
Install Butterknife:
sudo pip3 install butterknife
Listing templates
List local templates at /var/lib/butterknife/pool:
butterknife list
List local templates in a particular directory:
butterknife list file:///path/to/directory
List templates at /var/lib/butterknife/pool on a remote machine via SSH:
butterknife list ssh://hostname
List templates at remote machine via HTTP:
butterknife list http[s]://hostname[:port]
Pushing/pulling templates
Currently pull over SSH is working. Following replicates /var/lib/butterknife/pool from machine hostname to local pool at /var/lib/butterknife/pool:
butterknife pull ssh://hostname
You can also pull via HTTP:
butterknife pull http://butterknife.koodur.com
Note that symmetric push/pull requires patched btrfs-progs which has additional -p and -C flags for btrfs receive.
Multicast
Sending local template via multicast:
butterknife multicast send @template\:com.koodur.butterknife.Ubuntu\:x86_64\:snap7
You can even multicast a remote subvolume:
butterknife multicast send @template\:com.koodur.butterknife.Ubuntu\:x86_64\:snap7 --pool ssh://hostname
Receiving to local pool at /var/lib/butterknife/pool:
butterknife multicast receive
systemd-nspawn workflow
Create a btrfs subvolume for your butterknife image under /var/lib/machines. Replace ArchLinux with your image name you want to use.
sudo btrfs subvolume create /var/lib/machines/ArchLinux
Install base system in there
sudo pacstrap -i -c -d /var/lib/machines/ArchLinux base
Nspawn into it and customize your container
sudo systemd-nspawn -M ArchLinux
# do your thing
You will also need some scripts that will be ran on snapshot creation and when doing deployments with provision image.
look into the puppet-butterknife repository for scripts and files you should add
Create butterknife config file in /var/lib/machines/ArchLinux/etc/butterknife/butterknife.conf
[template]
name=ArchLinux
Also make sure that you have something like this on your host etc/butterknife/butterknife.conf config file
[global]
namespace=org.example.butterknife
endpoint=https://butterknife.example.org
Take a snapshot of your image
butterknife nspawn release ArchLinux
And now you should be ready to serve that image to your clients
Metadata
Release files for butterknife 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| butterknife-0.2.0.tar.gz | 19.3 kB | Details |
Release files / butterknife-0.2.0.tar.gz
| Download URL | butterknife-0.2.0.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71b9bc4753c26d71b62eac33c49805966f765b8a3199f2214dfd3e545ee52be7
|
|
BLAKE2b-256 checksum How to use checksums |
9a38a82310c322873de40d3545619e5c0924b844d21dd78eec52cb36a74a7217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |