-
Notifications
You must be signed in to change notification settings - Fork 36
Class[riak]: Parameters and Configuration
The module is centered around the riak class. The all-defaults configuration looks like this:
class { 'riak': }
You can modify the configuration by passing a hash to either cfg
(feeds into App.config) or to vmargs_cfg
, which feeds vm.args
. Here's an example of adding a https binding with a custom certfile and keyfile.
class { 'riak':
cfg => {
riak_core => {
https => {
"__string_${$::ipaddress}" => 8443
},
ssl => {
certfile => "${etc_dir}/cert.pem",
keyfile => "${etc_dir}/key.pem"
}
}
}
}
The configuration options are equal to any that Riak accepts. Have a look at Basho's wiki for a complete listing, or at the rebar-file in their repo.
The prefix __string_
is one of many. They work like this:
Create an Erlang tuple:
['__tuple_', 46, $::ipaddress, 'whatever']
Create an Erlang list:
['__list_', 46, $::ipaddress, 'whatever']
Create an Erlang atom:
'__atom_certfile'
Create an Erlang binary string:
'__binary_mystringcomeshere'
All keys in a puppet hash are translated by default to Erlang atoms, because that's what the config uses most of the time. In the case that you need a key to be translated to a string, e.g. like in this code:
class { riak:
cfg => {
# ...
riak_core => {
http => {
"__string_${$::ipaddress}" => 8098
}
# ...
}
}
you simply prefix the key with __string_
.
All hashes will be sorted on keys, in each layer, to make sure that the files change as little as possible from puppet run to puppet run.