Puppet: Parameter name failed on Package

22 Mar 2014

Puppet_logo

Since Puppet 3.4 (or Puppet Enterprise 3.2) a useful trick does not work anymore. It was an undocumented feature that allowed you to declare an alias on a list of packages in order to facilitate dependency handling.

For example if you want that an Exec requires a list of packages, you could write:

$packages_list = ['pkg1','pkg2','pkg3']

package{'alias':
  ensure => installed,
  name   => $packages_list,
}

exec{'my_awesome_exec':
  command => '...'
  require => Package['alias']
}

But that is not working anymore, you get the following error now:

Parameter name failed on Package['alias']: Name must be a String not Array

You can still keep the old behavior by using the “before” parameter:

package{$packages_list:
  ensure => installed,
  before => Exec['my_awesome_exec'],
}

exec{'my_awesome_exec':
  command => '...'
}

I never think of this (meta-)parameter…