On Sun, Feb 13, 2011 at 9:59 PM, Dan Bode <[email protected]> wrote:
>
> We have only been teaching <| |> in the puppetmaster training as a way to
> realize virtual resources. We do not teach that it is possible to override
> attributes with this syntax as well: <| |> {} (at least in part b/c the
> implications/non-determinism terrify me) , and do not teach that it actually
> effects all resources.
>
Why is using collections to override attributes non-deterministic compared
to class inheritance doing the same thing?
The common example from class is something like:
>
> class db::users {
> user { ['alice', 'bob']:
> ensure => present,
> gid => 'dbadmin',
> }
> }
>
> class app::users {
> user { ['charlie', 'bob']:
> ensure => present,
> gid => 'webadmin',
> }
> }
>
>
> class app {
> User<| gid == 'webadmin' |>
> ...
> }
>
> class db {
> User<| gid == 'dbadmin' |>
> ...
> }
>
> so that a machine can safely be a webserver and db server without conflict.
>
Why is this preferred over the realize() function? I consider the realize
function much simpler to teach and understand for this class of problem.
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.