I'm using puppet to provision a vagrant (ubuntu based) virtual machine.
In my script I need to:
sudo apt-get build-dep python-lxml
I know I can install the apt
puppet module so I can use:
apt::builddep { 'python-lxml': }
But I can't find any reference about installing a module from the script and how to include/require it. Seems to me that the puppet docs refer only to installing from the command line puppet tool
I also tried doing something like:
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";
}
But puppet exited with an error on this. And also:
exec{"install apt module":
command => "puppet module install puppetlabs/apt"
}
class { 'apt':
require => Exec["install apt module"]}
include apt
apt::builddep { 'python-imaging':
}
but got could not find declared class apt at..
any ideas? directions? I know I'm missing something obvious but can't figure this out.
EDIT: If I pre-install (with puppet module install
from the commandline) the apt:builddep
works fine. But I need puppet to handle the module downloading and installation. Some of the other work arounds also work for the basic use case but won't answer my main question.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…