Distro Signatures 发行版签名
在Cobbler 2.4.0之前,每个支持的发行版的导入模块是独立的,并针对每个特定的发行版进行了自定义。品种和os版本的值被硬编码到cobbler中,因此添加对新发行版的支持或已经支持的发行版的更新版本需要更改代码和完整的Cobbler升级。
Cobbler 2.4.0引入了发行版签名的概念,以便为新的发行版本添加支持,而无需升级到系统的其余部分。
Distro签名文件
发行版签名存储在/var/lib/cobbler/distro_signatures.json
。如扩展名所示,这是一个JSON格式的文件,具有以下结构:
{"breeds":
{
"<breed-name>": {
"<os-version1>": {
"signatures": "...",
"default_kickstart":"...",
...
},
...
}
...
}
}
当cobblerd启动时读入此文件,并记录一条消息,指出它已加载了多少品种和os版本:
INFO | 9 breeds and 21 OS versions read from the signature file
CLI命令
签名CLI命令具有以下子命令:
$ cobbler signature --help
usage
cobbler signature report
cobbler signature update
cobbler signature report
此命令打印出当前加载的签名和操作系统版本的报告。
$ cobbler signature report Currently loaded signatures: debian: squeeze freebsd: 8.2 8.3 9.0 generic: (none) redhat: fedora16 fedora17 fedora18 rhel4 rhel5 rhel6 suse: opensuse11.2 opensuse11.3 opensuse11.4 opensuse12.1 opensuse12.2 ubuntu: oneiric precise quantal unix: (none) vmware: esx4 esxi4 esxi5 windows: (none)
9 breeds with 21 total signatures loaded
可以指定可选的--name参数以将报告限制为一个品种:
$ cobbler signature report --name=ubuntu
Currently loaded signatures: ubuntu: oneiric precise quantal
Breed 'ubuntu' has 3 total signatures
cobbler signature update
此命令将使Cobbler从http://cobbler.github.con/signatures/latest.json获取最新的发行版签名文件,并在该文件中加载签名。将首先测试此文件,以确保其格式正确。
cobbler signature update
task started: 2012-11-21_222926_sigupdate
task started (id=Updating Signatures, time=Wed Nov 21 22:29:26 2012)
Successfully got file from http://cobbler.github.com/signatures/latest.json
TASK COMPLETE