How to prevent Repeated execution of cpan module install on multiple puppet runs

62 views
Skip to first unread message

swapnil...@ibiboryde.com

unread,
May 29, 2015, 9:55:29 AM5/29/15
to example42-pu...@googlegroups.com, Swapnil Jaiswal

#My code #

## install cpan minus perl module  via cpan ##
        perl::cpan::module {  'App::cpanminus':      }

#Noop output #
Notice: /Stage[main]/Perl::Cpan/Exec[configure_cpan]/returns: current_value notrun, should be 0 (noop)
Notice: Class[Perl::Cpan]: Would have triggered 'refresh' from 1 events

# Puppet client run output #
Notice: /Stage[main]/Perl::Cpan/Exec[configure_cpan]/returns: executed successfully

#
The puppet client run gives the above message every time I run the puppet client.
This behavior in NOT observed for the modules installed via CpanMinus.

How can i avoid the multiple executions -- of the cpan based perl module install ?

Alessandro Franceschi

unread,
May 30, 2015, 11:36:44 AM5/30/15
to example42-pu...@googlegroups.com, swapnil...@ibiboryde.com, jaiswal...@gmail.com
Hi, as a general rule try to run Puppet in debug mode and verify what command to used to check for the module's presence and why it doesn't correctly detect that the module is already installed.
In this specific case I wonder if it wouldn't be simpler to install cpanminus using https://github.com/example42/puppet-perl/blob/master/manifests/module.pp which is the alternative way to install modules and it uses cpanminus itself (automatically downloaded).

Regards,
al

swapnil...@ibiboryde.com

unread,
Jun 1, 2015, 10:04:20 AM6/1/15
to example42-pu...@googlegroups.com, swapnil...@ibiboryde.com, jaiswal...@gmail.com
Hi,

The installation code does not support the require command.
Is there an alternative way i can suggest to puppet that the perl module is already in place ?

Following is the snippet of puppet client run in debug mode.
Please suggest if the execution steps below are by design or is there something at my end ?


########
Debug: Exec[configure_cpan](provider=posix): Executing 'cpan <<EOF
yes
yes
no
no
http://www.perl.com/CPAN/

yes
quit
EOF'
Debug: Executing 'cpan <<EOF
yes
yes
no
no
http://www.perl.com/CPAN/

yes
quit
EOF'

Notice: /Stage[main]/Perl::Cpan/Exec[configure_cpan]/returns: executed successfully
Debug: /Stage[main]/Perl::Cpan/Exec[configure_cpan]: The container Class[Perl::Cpan] will propagate my refresh event
Debug: Exec[cpan-App::cpanminus-present](provider=posix): Executing check 'perldoc -l App::cpanminus'
Debug: Executing 'perldoc -l App::cpanminus'
Debug: /Stage[main]/Cloudwatch_monitor/Perl::Cpan::Module[App::cpanminus]/Exec[cpan-App::cpanminus-present]/unless: /usr/local/share/perl5/App/cpanminus.pm


##################
Reply all
Reply to author
Forward
0 new messages