On Tuesday, September 17, 2013 6:36:54 PM UTC-5, Charles Mean wrote:
>
> My question is, why the "define" redisInstance cannot create multiple
> instances when I use the "include" directive, but when I call the "file"
> directive into the define it create as many instances as I want ?
> For example, If I use the include directive and call de define as the
> following:
> redis::params::redisInstance {
> "redis_6379": redis_port => "6379", redis_host =>
> "192.168.100.97", slaveof => "127.0.0.1", master_port => "6872";
> "redis_6380": redis_port => "6380", redis_host =>
> "192.168.100.98", slaveof => "127.0.0.1", master_port => "6880";
> }
> It just creats a single instance(6379) and not the second one(6380).
>
It is a fundamental Puppet concept that classes are singletons. That means
assigning the same class to a node multiple times (e.g. via 'include')
doesn't mean anything more than assigning it once. This turns out to be
very useful.
Defined types, on the other hand, are resource types, very much analogous
to built-in types such as File. Like any other resource type, you can
declare multiple instances of a defined type, and each is distinct from the
others.
John
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.