Classes
cassandra
: A class for installing the Cassandra package and manipulate settings in the configuration file.cassandra::apache_repo
: An optional class that will allow a suitable repository to be configured from which packages for Apache Cassandra can be downloaded.cassandra::datastax_agent
: A class for installing the DataStax Agent and to point it at an OpsCenter instance.cassandra::datastax_repo
: An optional class that will allow a suitable repository to be configured from which packages for DataStax Community can be downloaded. Changcassandra::dse
: A class for configuring DataStax Enterprise (DSE) specific settings.cassandra::firewall_ports
: An optional class to configure incoming network ports on the host that are relevant to the Cassandra installation. If firewalls are being macassandra::java
: A class to install Java and JNA packages.cassandra::optutils
: A class to install the optional Cassandra tools package.cassandra::params
: This class is meant to be called from the locp-cassandra module. It sets variables according to platform.cassandra::schema
: A class to maintain the database schema. Please note that cqlsh expects Python 2.7 to be installed. This may be a problem of older distributions (CentOS 6 for example).cassandra::system::swapoff
: Disable swap on the node as suggested at http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.htmlcassandra::system::sysctl
: Set Sysctl (kernel runtime parameters) as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.htmcassandra::system::transparent_hugepage
: Disable Transparant Huge Pages as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html.
Defined types
cassandra::file
: A defined type for altering files relative to the configuration directory.cassandra::private::firewall_ports::rule
: A defined type to be used as a macro for setting host based firewall rules. This is not intended to be used by a user (who should use the APcassandra::schema::cql_type
: Create or drop user defined data types within the schema.cassandra::schema::index
: Create or drop indexes within the schema.cassandra::schema::keyspace
: Create or drop keyspaces within the schema.cassandra::schema::permission
: Grant or revoke permissions. To use this class, a suitableauthenticator
(e.g. PasswordAuthenticator) andauthorizer
(e.g. CassandraAuthocassandra::schema::table
: Create or drop tables within the schema.cassandra::schema::user
: Create or drop users. To use this class, a suitableauthenticator
(e.g. PasswordAuthenticator) must be set in the Cassandra class.
A class for installing the Cassandra package and manipulate settings in the configuration file.
The following parameters are available in the cassandra
class.
Data type: hash
If set, this is a baseline of settings that
are merged with the settings
hash. The values of the settings
hash overriding the values in this hash. This is most useful when used
with hiera.
Default value: {}
Data type: boolean
This will provide a workaround for CASSANDRA-2356 by sleeping for the specifed number of seconds after an event involving the Cassandra package. This option is silently ignored on the Red Hat family of operating systems as this bug only affects Debian systems.
Default value: 5
Data type: boolean
If set to true, this will apply a patch to the init file for the Cassandra service as a workaround for CASSANDRA-9822. This this bug only affects Debian systems.
Default value: false
Data type: string
The path to the Puppet template for the Cassandra configuration file. This allows the user to supply their own customized template.`
Default value: 'cassandra/cassandra.yaml.erb'
Data type: string
The path to the commitlog directory.
If set, the directory will be managed as a Puppet resource. Do not
specify a value here and in the settings
hash as they are mutually
exclusive.
Default value: undef
Data type: string
The mode for the
commitlog_directory
is ignored unless commitlog_directory
is
specified.
Default value: '0750'
Data type: Boolean
Whether or not to manage the cassandra configuration file.
Default value: true
Data type: string
The permissions mode of the cassandra configuration file.
Default value: '0644'
Data type: string
The path to the cassandra configuration file.
Default value: $cassandra::params::config_path
Data type: array
The path(s) to the date directory or
directories.
If set, the directories will be managed as a Puppet resource. Do not
specify a value here and in the settings
hash as they are mutually
exclusive.
Default value: undef
Data type: string
The mode for the
data_file_directories
is ignored unless data_file_directories
is
specified.
Default value: '0750'
Data type: string
Sets the value for dc in config_path/snitch_properties_file http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html for more details.
Default value: 'DC1'
Data type: string
Sets the value for dc_suffix in config_path/snitch_properties_file see http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html for more details. If the value is undef then no change will be made to the snitch properties file for this setting.
Default value: undef
Data type: boolean
A flag that dictates if the module should
fail if it is not RedHat or Debian. If you set this option to false then
you must also at least set the config_path
attribute as well.
Default value: true
Data type: string
The path to the hints directory.
If set, the directory will be managed as a Puppet resource. Do not
specify a value here and in the settings
hash as they are mutually
exclusive. Do not set this option in Cassandra versions before 3.0.0.
Default value: undef
Data type: string
The mode for the
hints_directory
is ignored unless hints_directory
is
specified.
Default value: '0750'
Data type: present|latest|string
The status of the package specified in package_name. Can be present, latest or a specific version number.
Default value: 'present'
Data type: string
The name of the Cassandra package which must be available from a repository.
Default value: $cassandra::params::cassandra_pkg
Data type: boolean
Sets the value for prefer_local in config_path/snitch_properties_file see http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html for more details. Valid values are true, false or undef. If the value is undef then change will be made to the snitch properties file for this setting.
Default value: undef
Data type: string
Sets the value for rack in config_path/snitch_properties_file see http://docs.datastax.com/en/cassandra/2.1/cassandra/architecture/architectureSnitchesAbout_c.html for more details.
Default value: 'RAC1'
Data type: string
The template for creating the snitch properties file.
Default value: 'cassandra/cassandra-rackdc.properties.erb'
Data type: string
The path to the saved caches directory.
If set, the directory will be managed as a Puppet resource. Do not
specify a value here and in the settings
hash as they are mutually
exclusive.
Default value: undef
Data type: string
The mode for the
saved_caches_directory
is ignored unless saved_caches_directory
is
specified.
Default value: '0750'
Data type: boolean
enable the Cassandra service to start at boot time.
Default value: true
Data type: string
Ensure the Cassandra service is running. Valid values are running or stopped.
Default value: undef
Data type: string
The name of the service that runs the Cassandra software.
Default value: 'cassandra'
Data type: string
The name of the provider that runs the service. If left as undef then the OS family specific default will be used, otherwise the specified value will be used instead.
Default value: undef
Data type: boolean
If set to true, changes to the Cassandra config file or the data directories will ensure that Cassandra service is refreshed after the changes. Setting this flag to false will disable this behaviour, therefore allowing the changes to be made but allow the user to control when the service is restarted.
Default value: true
Data type: hash
A hash that is passed to to_yaml
which dumps the results
to the Cassandra configuring file. The minimum required settings for
Cassandra 2.X are as follows:
{
'authenticator' => 'PasswordAuthenticator',
'cluster_name' => 'MyCassandraCluster',
'commitlog_directory' => '/var/lib/cassandra/commitlog',
'commitlog_sync' => 'periodic',
'commitlog_sync_period_in_ms' => 10000,
'data_file_directories' => ['/var/lib/cassandra/data'],
'endpoint_snitch' => 'GossipingPropertyFileSnitch',
'listen_address' => $::ipaddress,
'partitioner' => 'org.apache.cassandra.dht.Murmur3Partitioner',
'saved_caches_directory' => '/var/lib/cassandra/saved_caches',
'seed_provider' => [
{
'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
'parameters' => [
{
'seeds' => $::ipaddress,
},
],
},
],
'start_native_transport' => true,
}
For Cassandra 3.X you will also need to specify the hints_directory
attribute.
Default value: {}
Data type: string
The name of the snitch properties file. The full path name would be config_path/snitch_properties_file.
Default value: 'cassandra-rackdc.properties'
Data type: string
The full path to the systemctl command. Only needed when the package is installed. Will silently continue if the executable does not exist.
Default value: $cassandra::params::systemctl
An optional class that will allow a suitable repository to be configured from which packages for Apache Cassandra can be downloaded.
The following parameters are available in the cassandra::apache_repo
class.
Data type: string
On the Red Hat family, this is passed as the descr
attribute to a yumrepo
resource. On the Debian family, it is passed as
the comment
attribute to an apt::source
resource.
Default value: 'Repo for Apache Cassandra'
Data type: string
On the Debian family, this is passed as the id
attribute to an apt::key
resource. On the Red Hat family, it is
ignored.
Default value: 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA'
Data type: string
On the Debian family, this is passed as the
source
attribute to an apt::key
resource. On the Red Hat family,
it is set to the gpgkey
attribute on the yumrepo
resource.
Default value: 'https://www.apache.org/dist/cassandra/KEYS'
Data type: string
On the Red Hat family, leaving this as default will
set the baseurl
on the yumrepo
resource to
'http://www.apache.org/dist/cassandra/redhat' with whatever is set in the
'release' attribute appended.
On the Debian family, leaving this as the default
will set the location
attribute on an apt::source
to
'http://www.apache.org/dist/cassandra/debian'.
Default value: undef
Data type: string
On the Debian family, this is passed as the release
attribute to an apt::source
resource. On the Red Hat family, it is the
major version number of Cassandra, without dot, and with an appended 'x'
(e.g. '311x')
Default value: 'main'
A class for installing the DataStax Agent and to point it at an OpsCenter instance.
Set agent_alias to foobar, stomp_interface to localhost and ensure that async_pool_size is absent from the file.
class { 'cassandra::datastax_agent':
settings => {
'agent_alias' => {
'setting' => 'agent_alias',
'value' => 'foobar',
},
'stomp_interface' => {
'setting' => 'stomp_interface',
'value' => 'localhost',
},
'async_pool_size' => {
'ensure' => absent,
},
},
}
The following parameters are available in the cassandra::datastax_agent
class.
Data type: Any
The full path to the address config file.
Default value: '/var/lib/datastax-agent/conf/address.yaml'
Data type: Any
The full path name to the file where java_home
is set.
Default value: '/etc/default/datastax-agent'
Data type: Any
If the value of this variable is left as undef, no
action is taken. Otherwise the value is set as JAVA_HOME in
defaults_file
.
Default value: undef
Data type: Any
Is passed to the package reference. Valid values are present or a version number.
Default value: 'present'
Data type: Any
Is passed to the package reference.
Default value: 'datastax-agent'
Data type: Any
Is passed to the service reference.
Default value: 'running'
Data type: Any
Is passed to the service reference.
Default value: true
Data type: Any
Is passed to the service reference.
Default value: 'datastax-agent'
Data type: Any
The name of the provider that runs the service. If left as undef then the OS family specific default will be used, otherwise the specified value will be used instead.
Default value: undef
Data type: Any
A hash that is passed to [create_ini_settings] (https://github.com/puppetlabs/puppetlabs-inifile#function-create_ini_settings) with the following additional defaults:
{
path => $address_config_file,
key_val_separator => ': ',
require => Package[$package_name],
notify => Service['datastax-agent'],
}
Default value: {}
An optional class that will allow a suitable repository to be configured from which packages for DataStax Community can be downloaded. Changing the defaults will allow any Debian Apt or Red Hat Yum repository to be configured.
The following parameters are available in the cassandra::datastax_repo
class.
Data type: string
On the Red Hat family, this is passed as the descr
attribute to a yumrepo
resource. On the Debian family, it is passed as
the comment
attribute to an apt::source
resource.
Default value: 'DataStax Repo for Apache Cassandra'
Data type: string
On the Debian family, this is passed as the id
attribute to an apt::key
resource. On the Red Hat family, it is
ignored.
Default value: '7E41C00F85BFC1706C4FFFB3350200F2B999A372'
Data type: string
On the Debian family, this is passed as the
source
attribute to an apt::key
resource. On the Red Hat family,
it is ignored.
Default value: 'http://debian.datastax.com/debian/repo_key'
Data type: string
If left as the default, this will set the baseurl
to 'http://rpm.datastax.com/community' on a yumrepo
resource
on the Red Hat family. On the Debian family, leaving this as the default
will set the location
attribute on an apt::source
to
'http://debian.datastax.com/community'.
Default value: undef
Data type: string
On the Debian family, this is passed as the release
attribute to an apt::source
resource. On the Red Hat family, it is
ignored.
Default value: 'stable'
A class for configuring DataStax Enterprise (DSE) specific settings.
class { 'cassandra::dse':
file_lines => {
'Set HADOOP_LOG_DIR directory' => {
ensure => present,
path => '/etc/dse/dse-env.sh',
line => 'export HADOOP_LOG_DIR=/var/log/hadoop',
match => '^# export HADOOP_LOG_DIR=<log_dir>',
},
'Set DSE_HOME' => {
ensure => present,
path => '/etc/dse/dse-env.sh',
line => 'export DSE_HOME=/usr/share/dse',
match => '^#export DSE_HOME',
},
},
settings => {
ldap_options => {
server_host => localhost,
server_port => 389,
search_dn => 'cn=Admin',
search_password => secret,
use_ssl => false,
use_tls => false,
truststore_type => jks,
user_search_base => 'ou=users,dc=example,dc=com',
user_search_filter => '(uid={0})',
credentials_validity_in_ms => 0,
connection_pool => {
max_active => 8,
max_idle => 8,
}
}
}
}
The following parameters are available in the cassandra::dse
class.
Data type: string
The full path to the DSE configuration file.
Default value: '/etc/dse/dse.yaml'
Data type: string
The mode for the DSE configuration file.
Default value: '0644'
Data type: string
A path to a template for the dse.yaml
file.
Default value: 'cassandra/dse.yaml.erb'
Data type: hash
A hash of values that are passed to
create_resources
as a file_line
resource.
Default value: undef
Data type: boolean
Whether or not the Cassandra service should be refreshed if the DSE configuration files are changed.
Default value: true
Data type: hash
Unless this attribute is set to a hash (which is
then placed as YAML inside dse.yaml
) then the dse.yaml
is left
unchanged.
Default value: undef
An optional class to configure incoming network ports on the host that are relevant to the Cassandra installation. If firewalls are being managed already, simply do not include this module in your manifest.
IMPORTANT: The full list of which ports should be configured is assessed at evaluation time of the configuration. Therefore if one is to use this class, it must be the final cassandra class included in the manifest.
The following parameters are available in the cassandra::firewall_ports
class.
Data type: array
Only has any effect if the cassandra
class is defined on the node.
Allow these TCP ports to be opened for traffic coming from the client
subnets.
Default value: [9042, 9160]
Data type: array
Only has any effect if the cassandra
class is defined on the node.
An array of the list of subnets that are to allowed connection to
cassandra::native_transport_port and cassandra::rpc_port.
Default value: ['0.0.0.0/0']
Data type: array
Only has any effect if the cassandra
class is defined on the node.
Allow these TCP ports to be opened for traffic between the Cassandra nodes.
Default value: [7000, 7001, 7199]
Data type: array
Only has any effect if the cassandra
class is defined on the node.
An array of the list of subnets that are to allowed connection to
cassandra::storage_port
, cassandra::ssl_storage_port
and port 7199
for cassandra JMX monitoring.
Default value: ['0.0.0.0/0']
Data type: array
Allow these TCP ports to be opened for traffic
coming from public subnets the port specified in $ssh_port
will be
appended to this list.
Default value: [8888]
Data type: array
An array of the list of subnets that are to allowed connection to cassandra::firewall_ports::ssh_port.
Default value: ['0.0.0.0/0']
Data type: integer
Which port does SSH operate on.
Default value: 22
Data type: array
Only has any effect if the cassandra::datastax_agent
is defined.
Allow these TCP ports to be opened for traffic coming to or from OpsCenter
appended to this list.
Default value: [9042, 9160, 61620, 61621]
Data type: array
A list of subnets that are to be allowed connection to port 61621 for nodes built with cassandra::datastax_agent.
Default value: ['0.0.0.0/0']
A class to install Java and JNA packages.
The following parameters are available in the cassandra::java
class.
Data type: hash
If supplied, this should be a hash of apt::key
resources that will be passed to the create_resources function.
This is ignored on non-Debian systems.
Default value: undef
Data type: hash
If supplied, this should be a hash of
apt::source
resources that will be passed to the create_resources
function. This is ignored on non-Red Hat`
Default value: undef
Data type: string
Is passed to the package reference for the JNA
package. Valid values are present
or a version number.
Default value: present
Data type: string
The name of the JNA package.
Default value: $cassandra::params::jna_package_name
Data type: string
Is passed to the package reference for the JRE/JDK
package. Valid values are present
or a version number.
Default value: present
Data type: string
The name of the Java package to be installed.
Default value: $cassandra::params::java_package
Data type: hash
If supplied, this should be a hash of yumrepo resources that will be passed to the create_resources function. This is ignored on non-Red Hat systems.
Default value: undef
A class to install the optional Cassandra tools package.
The following parameters are available in the cassandra::optutils
class.
Data type: string
Can be present
, latest
or a specific
version number.
Default value: 'present'
Data type: string
The name of the optional utilities package to be installed.
Default value: $cassandra::params::optutils_package_name
This class is meant to be called from the locp-cassandra module. It sets variables according to platform.
A class to maintain the database schema. Please note that cqlsh expects Python 2.7 to be installed. This may be a problem of older distributions (CentOS 6 for example).
The following parameters are available in the cassandra::schema
class.
Data type: integer
How many times do try to connect to
Cassandra. See also connection_try_sleep
.
Default value: 6
Data type: integer
How much time to allow between the
number of tries specified in connection_tries
.
Default value: 30
Data type: hash
Creates new cassandra::schema::cql_type
resources.
Default value: {}
Data type: string
Any additional options to be passed
to the cqlsh
command.
Default value: ''
Data type: string
Set this to a file name (e.g. '/root/.puppetcqlshrc') that will then be used to contain the the credentials for connecting to Cassandra. This is a more secure option than having the credentials appearing on the command line. This option is only available in Cassandra >= 2.1.
Default value: undef
Data type: string
The location of the template for configuring
the credentials for the cqlsh client. This is ignored unless
cqlsh_client_config
is set.
Default value: 'cassandra/cqlshrc.erb'
Data type: string
The full path to the cqlsh
command.
Default value: '/usr/bin/cqlsh'
Data type: string
The host for the cqlsh
command to connect to.
See also cqlsh_port
.
Default value: 'localhost'
Data type: string
If credentials are require for connecting,
specify the password here. See also cqlsh_user
, cqlsh_client_config
.
Default value: undef
Data type: integer
The host for the cqlsh
command to connect to.
See also cqlsh_host
.
Default value: 9042
Data type: string
If credentials are required for connecting,
specify the password here. See also cqlsh_password
,
cqlsh_client_config
Default value: 'cassandra'
Data type: hash
Creates new cassandra::schema::index
resources.
Default value: {}
Data type: hash
Creates new cassandra::schema::keyspace
resources.
Default value: {}
Data type: hash
Creates new cassandra::schema::permission
resources.
Default value: {}
Data type: hash
Creates new cassandra::schema::table
resources.
Default value: {}
Data type: hash
Creates new cassandra::schema::user
resources.
Default value: {}
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Disable swap on the node as suggested at http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html
- See also cassandra::params
The following parameters are available in the cassandra::system::swapoff
class.
Data type: string
If provided a mount resource will be created to ensure that the device is absent from /etc/fstab to permanently disable swap.
Default value: undef
Data type: string
The name of the swap mount point. Ignored unless
device
has been set.
Default value: 'swap'
Data type: string
The full path to the file to check if swap is enabled.
Default value: '/proc/swaps'
Set Sysctl (kernel runtime parameters) as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html
If any of the values is set into the target file, the sysctl command will be called with the provided file name as an argument.
- See also cassandra::params
require cassandra::system::sysctl
The following parameters are available in the cassandra::system::sysctl
class.
Data type: string
Passed to the sysctl
command
Default value: '-p'
Data type: string
Path to the file to insert the settings into.
Default value: $cassandra::params::sysctl_file
Data type: integer
The value to set for net.core.optmem_max
Default value: 40960
Data type: integer
The value to set for net.core.rmem_default.
Default value: 16777216
Data type: integer
The value to set for net_core_rmem_max.
Default value: 16777216
Data type: integer
The value to set for net.core.wmem_default.
Default value: 16777216
Data type: integer
The value to set for net.core.wmem_max.
Default value: 16777216
Data type: string
The value to set for net.ipv4.tcp_rmem.
Default value: $cassandra::params::net_ipv4_tcp_rmem
Data type: string
The value to set for net.ipv4.tcp_wmem.
Default value: $cassandra::params::net_ipv4_tcp_wmem
Data type: integer
The value to set for vm.max_map_count.
Default value: 1048575
Disable Transparant Huge Pages as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html.
- See also cassandra::params
The following parameters are available in the cassandra::system::transparent_hugepage
class.
Data type: string
The full path to the file for checking/setting if Transparent Hugepages is enabled.
Default value: '/sys/kernel/mm/transparent_hugepage/defrag'
A defined type for altering files relative to the configuration directory.
if $::memorysize_mb < 24576.0 {
$max_heap_size_in_mb = floor($::memorysize_mb / 2)
} elsif $::memorysize_mb < 8192.0 {
$max_heap_size_in_mb = floor($::memorysize_mb / 4)
} else {
$max_heap_size_in_mb = 8192
}
$heap_new_size = $::processorcount * 100
cassandra::file { "Set Java/Cassandra max heap size to ${max_heap_size_in_mb}.":
file => 'cassandra-env.sh',
file_lines => {
'MAX_HEAP_SIZE' => {
line => "MAX_HEAP_SIZE='${max_heap_size_in_mb}M'",
match => '^#?MAX_HEAP_SIZE=.*',
},
}
}
cassandra::file { "Set Java/Cassandra heap new size to ${heap_new_size}.":
file => 'cassandra-env.sh',
file_lines => {
'HEAP_NEWSIZE' => {
line => "HEAP_NEWSIZE='${heap_new_size}M'",
match => '^#?HEAP_NEWSIZE=.*',
}
}
}
$tmpdir = '/var/lib/cassandra/tmp'
file { $tmpdir:
ensure => directory,
owner => 'cassandra',
group => 'cassandra',
}
cassandra::file { 'Set java.io.tmpdir':
file => 'jvm.options',
file_lines => {
'java.io.tmpdir' => {
line => "-Djava.io.tmpdir=${tmpdir}",
},
},
require => File[$tmpdir],
}
The following parameters are available in the cassandra::file
defined type.
Data type: string
The name of the file relative to the config_path
.
Default value: $title
Data type: string
The path to the configuration directory.
Default value: $cassandra::config_path
Data type: string
If set, then the [create_resources] (https://docs.puppet.com/puppet/latest/reference/function.html#createresources) will be used to create an array of [file_line] (https://forge.puppet.com/puppetlabs/stdlib#file_line) resources.
Default value: undef
Data type: boolean
Is the Cassandra service is to be notified if the environment file is changed.
Default value: true
A defined type to be used as a macro for setting host based firewall rules. This is not intended to be used by a user (who should use the API provided by cassandra::firewall_ports instead) but is documented here for completeness.
The following parameters are available in the cassandra::private::firewall_ports::rule
defined type.
Data type: integer
The number(s) of the port(s) to be opened.
Create or drop user defined data types within the schema.
cassandra::schema::cql_type { 'fullname':
keyspace => 'mykeyspace',
fields => {
'fname' => 'text',
'lname' => 'text',
},
}
The following parameters are available in the cassandra::schema::cql_type
defined type.
Data type: string
The name of the keyspace that the data type is to be associated with.
Data type: present|absent
ensure the data type is created, or is dropped.
Default value: present
Data type: hash
A hash of the fields that will be components for the data type.
Default value: {}
Data type: string
The name of the CQL type to be created.
Default value: $title
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Create or drop indexes within the schema.
The following parameters are available in the cassandra::schema::index
defined type.
Data type: present|absent
Create or dro[ the index.
Default value: present
Data type: string
The name of the class to be associated with an index when creating a custom index.
Default value: undef
Data type: string
The name of the index. Defaults to the name of the resource.
Default value: $title
Data type: string
The columns that the index is being created on.
Default value: undef
Data type: string
The name the keyspace that the index is to be associated with.
Data type: string
Any options to be added to the index.
Default value: undef
Data type: string
The name of the table that the index is to be associated with.
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Create or drop keyspaces within the schema.
$network_topology_strategy = {
keyspace_class => 'NetworkTopologyStrategy',
dc1 => 3,
dc2 => 2
}
cassandra::schema::keyspace { 'mykeyspace':
replication_map => {
keyspace_class => 'SimpleStrategy',
replication_factor => 1,
},
durable_writes => false,
}
The following parameters are available in the cassandra::schema::keyspace
defined type.
Data type: present|absent
Create or drop the keyspace.
Default value: present
Data type: boolean
When set to false, data written to the keyspace bypasses the commit log. Be careful using this option because you risk losing data. Set this attribute to false on a keyspace using the SimpleStrategy.
Default value: true
Data type: string
The name of the keyspace to be created.
Default value: $title
Data type: hash
Needed if the keyspace is to be present. Optional if it is to be absent.
Default value: {}
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Grant or revoke permissions.
To use this class, a suitable authenticator
(e.g. PasswordAuthenticator)
and authorizer
(e.g. CassandraAuthorizer) must be set in the Cassandra
class.
WARNING: Specifying keyspace 'ALL' and 'ALL' for permissions at the same time is not currently supported by this module.
The following parameters are available in the cassandra::schema::permission
defined type.
Data type: string
The name of the user who is to be granted or revoked.
Data type: present | absent
Set to present to grant a permission or absent to revoke it.
Default value: present
Data type: string
The name of the keyspace to grant/revoke the permissions on. If set to 'ALL' then the permission will be applied to all of the keyspaces.
Default value: 'ALL'
Data type: string
Can be one of the following:
- 'ALTER' - ALTER KEYSPACE, ALTER TABLE, CREATE INDEX, DROP INDEX.
- 'AUTHORIZE' - GRANT, REVOKE.
- 'CREATE' - CREATE KEYSPACE, CREATE TABLE.
- 'DROP' - DROP KEYSPACE, DROP TABLE.
- 'MODIFY' - INSERT, DELETE, UPDATE, TRUNCATE.
- 'SELECT' - SELECT.
If the permission_name is set to 'ALL', this will set all of the specific permissions listed.
Default value: 'ALL'
Data type: string
The name of a table within the specified keyspace. If left unspecified, the procedure will be applied to all tables within the keyspace.
Default value: undef
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Create or drop tables within the schema.
cassandra::schema::table { 'users':
keyspace => 'mykeyspace',
columns => {
'userid' => 'int',
'fname' => 'text',
'lname' => 'text',
'PRIMARY KEY' => '(userid)',
},
}
The following parameters are available in the cassandra::schema::table
defined type.
Data type: string
The name of the keyspace.
Data type: hash
A hash of the columns to be placed in the table. Optional if the table is to be absent.
Default value: {}
Data type: present|absent
Ensure a keyspace is created or dropped.
Default value: present
Data type: array
Options to be added to the table creation.
Default value: []
Data type: string
The name of the table. Defaults to the name of the resource.
Default value: $title
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name
Create or drop users.
To use this class, a suitable authenticator
(e.g. PasswordAuthenticator)
must be set in the Cassandra class.
cassandra::schema::user { 'akers':
password => 'Niner2',
superuser => true,
}
cassandra::schema::user { 'lucan':
ensure => absent,
}
The following parameters are available in the cassandra::schema::user
defined type.
Data type: present | absent
Valid values can be present to ensure a user is created, or absent to remove the user if it exists.
Default value: present
Data type: string
A password for the user.
Default value: undef
Data type: boolean
If the user is to be a super-user on the system.
Default value: false
Data type: boolean
Allows the role to log in.
Default value: true
Data type: string
The name of the user.
Default value: $title
Data type: Boolean
Default value: $cassandra::params::use_scl
Data type: String[1]
Default value: $cassandra::params::scl_name