community.general.cpanm (8.5.0) — module

Manages Perl library dependencies

Authors: Franck Cuny (@fcuny), Alexei Znamensky (@russoz)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage Perl library dependencies using cpanminus.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer perl package
  community.general.cpanm:
    name: Dancer
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install version 0.99_05 of the Plack perl package
  community.general.cpanm:
    name: MIYAGAWA/Plack-0.99_05.tar.gz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer into the specified locallib
  community.general.cpanm:
    name: Dancer
    locallib: /srv/webapps/my_app/extlib
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install perl dependencies from local directory
  community.general.cpanm:
    from_path: /srv/webapps/my_app/src/
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer perl package without running the unit tests in indicated locallib
  community.general.cpanm:
    name: Dancer
    notest: true
    locallib: /srv/webapps/my_app/extlib
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer perl package from a specific mirror
  community.general.cpanm:
    name: Dancer
    mirror: 'http://cpan.cpantesters.org/'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer perl package into the system root path
  become: true
  community.general.cpanm:
    name: Dancer
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install Dancer if it is not already installed OR the installed version is older than version 1.0
  community.general.cpanm:
    name: Dancer
    version: '1.0'

Inputs

    
mode:
    choices:
    - compatibility
    - new
    description:
    - Controls the module behavior. See notes below for more details.
    - Default is V(compatibility) but that behavior is deprecated and will be changed
      to V(new) in community.general 9.0.0.
    type: str
    version_added: 3.0.0
    version_added_collection: community.general

name:
    aliases:
    - pkg
    description:
    - The Perl library to install. Valid values change according to the O(mode), see notes
      for more details.
    - Note that for installing from a local path the parameter O(from_path) should be
      used.
    type: str

mirror:
    description:
    - Specifies the base URL for the CPAN mirror to use.
    type: str

notest:
    default: false
    description:
    - Do not run unit tests.
    type: bool

version:
    description:
    - Version specification for the perl module. When O(mode) is V(new), C(cpanm) version
      operators are accepted.
    type: str

locallib:
    description:
    - Specify the install base to install modules.
    type: path

from_path:
    description:
    - The local directory or C(tar.gz) file to install from.
    type: path

executable:
    description:
    - Override the path to the cpanm executable.
    type: path

name_check:
    description:
    - When O(mode=new), this parameter can be used to check if there is a module O(name)
      installed (at O(version), when specified).
    type: str
    version_added: 3.0.0
    version_added_collection: community.general

installdeps:
    default: false
    description:
    - Only install dependencies.
    type: bool

mirror_only:
    default: false
    description:
    - Use the mirror's index file instead of the CPAN Meta DB.
    type: bool