Issue #22587 has been updated by Stefan Schulte.
Status changed from Unreviewed to Needs More Information
Assignee set to Vadim Nevorotin
Priority changed from Urgent to Normal
To be honest I don't really understand what you are asking for. If you have a
property with a default value than not specifying a value means that the
default takes place, e.g. if you specify
<pre>
user { 'foo':
ensure => present,
}
</pre>
and you have not specified the `system` parameter it will be set to false, so
the above statement is the same as specifying
<pre>
user { 'foo':
ensure => present,
system => false,
}
</pre>
Defining default values for all properties is cleary not desired because you
would not be able to partly manage a resource - you will always manage every
attribute of a resource because you've either set it explicitly or it was
implicitly set to a default value. I also don't quite get the problem were
having default values for every type would be handy, so please help me
understand the actual problem.
----------------------------------------
Feature #22587: Default value for all type's atrributes
https://projects.puppetlabs.com/issues/22587#change-98793
* Author: Vadim Nevorotin
* Status: Needs More Information
* Priority: Normal
* Assignee: Vadim Nevorotin
* Category:
* Target version:
* Affected Puppet version:
* Keywords:
* Branch:
----------------------------------------
Each attribute for all built-in types must have default values. (from here:
http://docs.puppetlabs.com/references/3.stable/type.html)
It's very important when you wrap some type with parametrized class/defined
type. I that case you should pass parameters from container to wrapped type. So
you must know default values for all type's attribute to add then as default
values for class/defined type.
E.g. you has standard package->config->service parametrized class. You want to
add enable and ensure attributes of service to main class:
class someclass (
$ensure = ????,
$enabled = ????,
...
) {
service {'someservice':
ensure => $ensure,
enabled => $enabled,
...
Now you can't simply use default values of attributes from service to class,
because there is no default values. So behavior of whole class differs from
behavior of a service. And so there is a lot of problems in large installations.
See http://projects.puppetlabs.com/issues/22580 - here is one of examples.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.