About | FAQ | Help
Ask Your Question

Revision history [back]

This isn't possible in the way you're trying to write it. I'd suggest setting the default value of $package to undef, then in the body of myclass, set it based on $ldap_enable unless already set.

class myclass(
  $package             = undef,
  $ldap_enable         = false,
) inherits myclass::params {
  unless $package {
    $package = $ldap_enable ? {
      true    => 'packageldap',
      default => 'packagestandard',