ansible.builtin.cpanm (v2.9.27) — module

Manages Perl library dependencies.

| "added in version" 1.6 of ansible.builtin"

Authors: Franck Cuny (@fcuny)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manage Perl library dependencies.

Usage examples

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

Inputs

    
name:
    aliases:
    - pkg
    description:
    - The name of the Perl library to install. You may use the "full distribution path",
      e.g.  MIYAGAWA/Plack-0.99_05.tar.gz

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:
    - minimum version of perl module to consider acceptable
    type: str
    version_added: '2.1'
    version_added_collection: ansible.builtin

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

from_path:
    description:
    - The local directory from where to install

executable:
    description:
    - Override the path to the cpanm executable
    type: path
    version_added: '2.1'
    version_added_collection: ansible.builtin

system_lib:
    aliases:
    - use_sudo
    default: false
    description:
    - 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.
    type: bool
    version_added: '2.0'
    version_added_collection: ansible.builtin

installdeps:
    default: false
    description:
    - Only install dependencies
    type: bool
    version_added: '2.0'
    version_added_collection: ansible.builtin

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