butterknife使用linux容器(lxc)和btrfs文件系统使裸机linux部署变得非常简单。

butterknife的Python项目详细描述


简介

butterknife命令行实用程序可用于通过http提供快照; 通过ssh和多播发送和接收快照; 列出本地和远程快照。

安装

安装依赖项:

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

安装蝶形刀:

sudo pip3 install butterknife

列表模板

在/var/lib/butterknife/pool上列出本地模板:

butterknife list

列出特定目录中的本地模板:

butterknife list file:///path/to/directory

通过ssh在远程机器上的/var/lib/butterknife/pool中列出模板:

butterknife list ssh://hostname

通过http:

在远程计算机上列出模板
butterknife list http[s]://hostname[:port]

推/拉模板

当前切换ssh正在工作。复制后 /var/lib/butterknife/pool从机器hostname到本地池 at/var/lib/butterknife/池:

butterknife pull ssh://hostname

您也可以通过http:

butterknife pull http://butterknife.koodur.com

请注意,对称推/拉需要修补的btrfs prog,该prog具有btrfs receive的附加-p和-c标志。

多播

通过多播发送本地模板:

butterknife multicast send @template\:com.koodur.butterknife.Ubuntu\:x86_64\:snap7

您甚至可以多播远程子卷:

butterknife multicast send @template\:com.koodur.butterknife.Ubuntu\:x86_64\:snap7 --pool ssh://hostname

在/var/lib/butterknife/pool接收到本地池:

butterknife multicast receive

systemd nspawn工作流

在/var/lib/machines下为butterknife图像创建一个btrfs子卷。 用您要使用的映像名替换archlinux。

sudo btrfs subvolume create /var/lib/machines/ArchLinux

在其中安装基本系统

sudo pacstrap -i -c -d /var/lib/machines/ArchLinux base

插入并自定义容器

sudo systemd-nspawn -M ArchLinux
# do your thing

您还需要一些脚本,这些脚本将在创建快照时运行,以及 使用配置映像执行部署。

puppet-butterknife存储库中查找应该添加的脚本和文件

在中创建butterknife配置文件 /var/lib/machines/archlinux/etc/butterknife/butterknife.conf

[template]name=ArchLinux

还要确保你的主人身上有这样的东西 etc/butterknife/butterknife.conf配置文件

[global]namespace=org.example.butterknifeendpoint=https://butterknife.example.org

为您的图像拍摄快照

butterknife nspawn release ArchLinux

现在你应该准备好为你的客户提供这种形象

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java ajax请求不允许POST请求   java引用Android应用程序中其他模块的通用模块   JavaSpringBootWebFluxFlatmap是链接http调用的正确方法吗?   java如何在底部工作表中设置折叠工具栏?   任务“:compileJava”的java执行失败。“>无效的源版本:1.7   java Rabbit MQ不刷新ACK?   JavaWebSphere7:METAINF/config/ibmaxis2。无法正确加载xml Axis2全局配置文件   在Java中找出字符串是否包含数组中的值   java Liquibase通过Springboot执行postgres方法   java在Eclipse中安装Maven而不使用插件   Swing应用程序中的java SMTP错误   web应用程序InvalidKeyException:Java中使用RSA密钥的密钥格式无效   java显示JFrame作为JButton单击的结果?   java如何保留Apache Camel Exchange的属性,如果消息是从RabbitMQ生成和使用的   java使用流提取哈希映射列表中的所有对象   Android应用程序中的java单词检查器