Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample usage errors out with missing package_name argument #59

Open
seanhoughton opened this issue Mar 9, 2021 · 2 comments
Open

Sample usage errors out with missing package_name argument #59

seanhoughton opened this issue Mar 9, 2021 · 2 comments

Comments

@seanhoughton
Copy link

The required package_name argument of the cpan class is not documented. Using the provided sample config results in the following error:

Class[Cpan]: expects a value for parameter 'package_name'

The source code references this in the cpan::install class which is only mentioned in the docs as "Handles package installation".

What is the correct way to use this module?

@seanhoughton
Copy link
Author

Setting the package_name property to the package results in an error

  class {'::cpan':
    manage_package => true,
    package_ensure => 'present',
    package_name   => 'JSON',
    config_hash    => { 'build_requires_install_policy' => 'no' },
  }
Server Error: Evaluation Error: Missing title. The title expression resulted in undef at /opt/puppetlabs/puppet/modules/cpan/manifests/config.pp:15:12

@faxm0dem
Copy link
Member

I'm sorry the documentation didn't help you.
If you want to install a cpan package, you want to use the cpan resource, not the class:

cpan { 'JSON':
  ensure => 'present',
}

The cpan class's package_name parameter refers to the name of the cpan package itself, e.g. perl-cpan on RedHat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants