Vagrant: Install Perl module Monitoring::Generator::TestConfig

refs #4506
This commit is contained in:
Eric Lippmann 2013-08-13 10:17:44 +02:00
parent 99871e73bd
commit 6ce47f297b
3 changed files with 53 additions and 0 deletions

View File

@ -384,3 +384,8 @@ exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql':
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Pgsql',
require => Exec['install ZendFramework']
}
cpan { 'Monitoring::Generator::TestConfig':
creates => '/usr/local/share/perl5/Monitoring/Generator/TestConfig.pm',
timeout => 600
}

View File

@ -0,0 +1,43 @@
# Define: cpan
#
# Download and install Perl modules from the Perl Archive Network, the gateway to all things Perl.
# The canonical location for Perl code and modules.
#
# Parameters:
# [*creates*] - target directory the software will install to.
# [*timeout* ] - timeout for the CPAN command.
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# cpan { 'perl-module':
# creates => '/usr/local/share/perl5/perl-module',
# timeout => 600
# }
#
define cpan(
$creates,
$timeout
) {
Exec { path => '/usr/bin' }
package { 'perl-CPAN':
ensure => installed
}
file { '/root/.cpan/CPAN/MyConfig.pm':
content => template('cpan/MyConfig.pm.erb'),
require => Package['perl-CPAN']
}
exec { "cpan-${name}":
command => "perl -MCPAN -e 'install ${name}'",
creates => $creates,
require => File['/root/.cpan/CPAN/MyConfig.pm'],
timeout => $timeout
}
}

View File

@ -0,0 +1,5 @@
$CPAN::Config = {
'prerequisites_policy' => q[follow]
};
1;
__END__