Hello

When using class parameters I often face the same issue regarding undef usage.
Let's say I got this simple class:

class foo (
  $service_ensure = 'running',
) {
  service { 'foo':
     ensure => $service_ensure;
  }
}


include foo # will set the service running


class { 'foo':
  service_ensure => 'stopped'; # will set the service stopped
}


And now, I would like to say 'do not care about ensure'. Do not touch it.
For that, I need that ensure is set to 'undef'

But I cannot use:

class { 'foo':
  service_ensure => undef;
}

because in this case, Puppet will use the default value of the parameter, in this case: running.

I have this problem for a lot of different modules and I looking for a simple way to do this.
I would like to avoid adding an if/else in all my classes.


Thanks in advance

Aurélien

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/562F3DD7.8010008%40cea.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to