Documentation

cpanm - Manages Perl library dependencies.

New in version 1.6.

Synopsis

  • Manage Perl library dependencies.

Options

parameter required default choices comments
executable
(added in 2.1)
no
Override the path to the cpanm executable
from_path
no
The local directory from where to install
installdeps
(added in 2.0)
no
Only install dependencies
locallib
no
Specify the install base to install modules
mirror
no
Specifies the base URL for the CPAN mirror to use
mirror_only
no
Use the mirror's index file instead of the CPAN Meta DB
name
no
The name of the Perl library to install. You may use the "full distribution path", e.g. MIYAGAWA/Plack-0.99_05.tar.gz

aliases: pkg
notest
no
Do not run unit tests
system_lib
(added in 2.0)
no
Use this if you want to install modules to the system perl include path. You must be root or have "passwordless" sudo for this to work.
This uses the cpanm commandline option '--sudo', which has nothing to do with ansible privilege escalation.

aliases: use_sudo
version
(added in 2.1)
no
minimum version of perl module to consider acceptable

Examples

# install Dancer perl package
- cpanm:
    name: Dancer

# install version 0.99_05 of the Plack perl package
- cpanm:
    name: MIYAGAWA/Plack-0.99_05.tar.gz

# install Dancer into the specified locallib
- cpanm:
    name: Dancer
    locallib: /srv/webapps/my_app/extlib

# install perl dependencies from local directory
- cpanm:
    from_path: /srv/webapps/my_app/src/

# install Dancer perl package without running the unit tests in indicated locallib
- cpanm:
    name: Dancer
    notest: True
    locallib: /srv/webapps/my_app/extlib

# install Dancer perl package from a specific mirror
- cpanm:
    name: Dancer
    mirror: 'http://cpan.cpantesters.org/'

# install Dancer perl package into the system root path
- cpanm:
    name: Dancer
    system_lib: yes

# install Dancer if it's not already installed
# OR the installed version is older than version 1.0
- cpanm:
    name: Dancer
    version: '1.0'

Notes

Note

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.