Skip to content

voxpupuli/puppet-cpanm

cpanm

CI Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores AGPL v3 License Donated by

Table of Contents

  1. Description
  2. Setup - The basics of getting started with cpanm
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

The cpanm module manages CPAN packages using the cpanminus package. It exists to provide a simple way to install CPAN modules with the option to not run test suites. The intent is that it should work with Debianish and Redhatty distributions.

The module provides a class cpanm which will install Perl components, gcc, make and cpanminus itself. It also provides a resource type cpanm which you can use to manage modules in more or less the same way as package works.

Setup

What cpanm affects

This module will install the following packages unless manage_dependencies is set to false:

  • perl
  • gcc
  • make
  • perl-core on RHEL7

It will also install cpanm itself in a standard directory, generally /usr/bin or /usr/local/bin.

Setup Requirements

This module uses curl to download the cpanminus installer.

Beginning with cpanm

include cpanm

cpanm {'CGI':
  ensure => latest,
}

Usage

Both the cpanm class and resource support a mirror parameter to control which CPAN archive packages are fetched from. The cpanm resource supports additional parameters, test and force, to enable CPAN tests and force CPAN installation respectively.

Limitations

The listing of installed CPAN modules is based on perldoc perllocal. This generally works well, but doesn't get updated when you remove a CPAN module.

Development

This module is maintained by Vox Pupuli. Vox Pupuli welcomes new contributions to this module, especially those that include documentation and rspec tests. We are happy to provide guidance if necessary.

Please see CONTRIBUTING for more details.

Please log tickets and issues on github.

Transfer Notice

This module was originally authored by James McDonald james@jamesmcdonald.com. The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance. Existing pull requests and issues were transferred over, please fork and continue to contribute here instead.

Previously: https://github.com/jamesmcdonald/puppet-cpanm