An error occurs when trying to add a printer with the puppet manifest

38 views Asked by At

evereyone. my ask foreman ticker error cups next text:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Class[Cups]: parameter 'package_names' expects a value of type String or Array, got Undef (file: /etc/puppetlabs/code/environments/production/manifests/mc_hp_mfp_m428fdn_hp0a7a0e_10_139_2_85.pp, line: 3, column: 5) on node ws-ac2d.local

file manifests conf default col.

Variant[String, Array[String]]           $package_names          = $::cups::params::package_names,

what problem?

im install cups puppet module install leoarnold-cups --version 2.2.2 needed add printer work ps, foreman manifests

class mc_hp_mfp_m428fdn_hp0a7a0e_10_139_2_85 {
#A8B13B0A7A0E
    include ::cups
    cups_queue { 'mc_hp_mfp_m428fdn_hp099a15_10_139_2_85':
    ensure => 'printer',
    model  => 'drv:///sample.drv/generpcl.ppd',
    uri    => 'ipp://10.139.2.85',
    accepting => true,
    enabled   => true,
    shared => false,
    location => 'Местоположение неизвестно',
    }
}
1

There are 1 answers

0
John Bollinger On

Most likely, the problem is that the target machine's OS is not among those for which the module has built-in package-name defaults. If you look in the module's cups::params class, you will find that it knows about:

  • Several specific Debian-family Linuxes
    • Debian >= 7
    • Ubuntu >= 14.04
    • Mint >= 17
  • All RedHat-family Linuxes (generically)
  • All Suse-family Linuxes (generically)

The details of that class may also give you an idea of what packages you need for other distros.

To resolve the issue, you will need to specify an appropriate value for the package_names parameter of the cups class. It's usually best to use Hiera data to customize class parameters, but you do also have the option of doing via a resource-like declaration of class cups.