【发布时间】:2013-07-04 16:33:41
【问题描述】:
我正在使用 puppet 来配置一个 vagrant(基于 ubuntu)的虚拟机。 在我的脚本中,我需要:
sudo apt-get build-dep python-lxml
我知道我可以安装 apt puppet module 以便我可以使用:
apt::builddep { 'python-lxml': }
但我找不到任何关于从脚本安装模块以及如何包含/需要它的参考。在我看来,木偶文档仅指installing from the command line puppet tool
我也尝试过这样做:
define build_dep($pkgname){
exec {
"builddepend_$pkgname":
commmand => "sudo apt-get build-dep $pkgname";
}
}
build_dep{
"python-imaging":
pkgname => "python-imaging";
"python-lxml":
pkgname => "python-lxml";
}
但是 puppet 退出时出现错误。还有:
exec{"install apt module":
command => "puppet module install puppetlabs/apt"
}
class { 'apt':
require => Exec["install apt module"]}
include apt
apt::builddep { 'python-imaging':
}
但得到could not find declared class apt at..
有什么想法吗?方向?我知道我遗漏了一些明显的东西,但无法弄清楚。
编辑:如果我预先安装(使用命令行中的puppet module install)apt:builddep 工作正常。 但我需要 puppet 来处理模块下载和安装。其他一些解决方法也适用于基本用例,但不会回答我的主要问题。
【问题讨论】: