Vagrant: Install Perl module Monitoring::Generator::TestConfig
refs #4506
This commit is contained in:
parent
99871e73bd
commit
6ce47f297b
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
$CPAN::Config = {
|
||||
'prerequisites_policy' => q[follow]
|
||||
};
|
||||
1;
|
||||
__END__
|
Loading…
Reference in New Issue