Hello guys,
I'm creating a module to manage redis, and facing just a little problem
with that.
I have the following init.pp
class redis {
include redis::install
include redis::service
include redis::params # redis:: params also import
# redis::config and
# redis::monitoring
}
My params class receive some parameters from a define called redisInstance:
class redis::params {
define redisInstance ($redis_port = 6379, $redis_host = "127.0.0.1",
$slaveof = false, $master_port = false) {
include redis::config, redis::monitoring
}
}
Into redisInstance I have two includes to both, configure and monitoring
redis, with I do based on the given parameters.
The problem is that I'm not able to create a second instance just like this:
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";
}
Finally, the part which should configure multiple instances is on config.pp
and is the following:
file { "/etc/redis/redis_${redis_port}.conf":
ensure => file,
content => template("redis/config/redis.conf.erb"),
mode => 0644,
notify => Class["redis::service"];
}
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).
--
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.