Skip to content

Latest commit

 

History

History
1869 lines (1113 loc) · 39.2 KB

REFERENCE.md

File metadata and controls

1869 lines (1113 loc) · 39.2 KB

Reference

Table of Contents

Classes

Defined types

Classes

cassandra

A class for installing the Cassandra package and manipulate settings in the configuration file.

Parameters

The following parameters are available in the cassandra class.

baseline_settings

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: {}

cassandra_2356_sleep_seconds

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

cassandra_9822

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

cassandra_yaml_tmpl

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'

commitlog_directory

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

commitlog_directory_mode

Data type: string

The mode for the commitlog_directory is ignored unless commitlog_directory is specified.

Default value: '0750'

manage_config_file

Data type: Boolean

Whether or not to manage the cassandra configuration file.

Default value: true

config_file_mode

Data type: string

The permissions mode of the cassandra configuration file.

Default value: '0644'

config_path

Data type: string

The path to the cassandra configuration file.

Default value: $cassandra::params::config_path

data_file_directories

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_file_directories_mode

Data type: string

The mode for the data_file_directories is ignored unless data_file_directories is specified.

Default value: '0750'

dc

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'

dc_suffix

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

fail_on_non_supported_os

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

hints_directory

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

hints_directory_mode

Data type: string

The mode for the hints_directory is ignored unless hints_directory is specified.

Default value: '0750'

package_ensure

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'

package_name

Data type: string

The name of the Cassandra package which must be available from a repository.

Default value: $cassandra::params::cassandra_pkg

prefer_local

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

rack

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'

rackdc_tmpl

Data type: string

The template for creating the snitch properties file.

Default value: 'cassandra/cassandra-rackdc.properties.erb'

saved_caches_directory

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

saved_caches_directory_mode

Data type: string

The mode for the saved_caches_directory is ignored unless saved_caches_directory is specified.

Default value: '0750'

service_enable

Data type: boolean

enable the Cassandra service to start at boot time.

Default value: true

service_ensure

Data type: string

Ensure the Cassandra service is running. Valid values are running or stopped.

Default value: undef

service_name

Data type: string

The name of the service that runs the Cassandra software.

Default value: 'cassandra'

service_provider

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

service_refresh

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

settings

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: {}

snitch_properties_file

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'

systemctl

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

cassandra::apache_repo

An optional class that will allow a suitable repository to be configured from which packages for Apache Cassandra can be downloaded.

Parameters

The following parameters are available in the cassandra::apache_repo class.

descr

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'

key_id

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'

key_url

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'

pkg_url

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

release

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'

cassandra::datastax_agent

A class for installing the DataStax Agent and to point it at an OpsCenter instance.

Examples

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,
    },
  },
}

Parameters

The following parameters are available in the cassandra::datastax_agent class.

address_config_file

Data type: Any

The full path to the address config file.

Default value: '/var/lib/datastax-agent/conf/address.yaml'

defaults_file

Data type: Any

The full path name to the file where java_home is set.

Default value: '/etc/default/datastax-agent'

java_home

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

package_ensure

Data type: Any

Is passed to the package reference. Valid values are present or a version number.

Default value: 'present'

package_name

Data type: Any

Is passed to the package reference.

Default value: 'datastax-agent'

service_ensure

Data type: Any

Is passed to the service reference.

Default value: 'running'

service_enable

Data type: Any

Is passed to the service reference.

Default value: true

service_name

Data type: Any

Is passed to the service reference.

Default value: 'datastax-agent'

service_provider

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

settings

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: {}

cassandra::datastax_repo

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.

Parameters

The following parameters are available in the cassandra::datastax_repo class.

descr

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'

key_id

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'

key_url

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'

pkg_url

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

release

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'

cassandra::dse

A class for configuring DataStax Enterprise (DSE) specific settings.

Examples

Configure a cluster with LDAP authentication
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,
      }
    }
  }
}

Parameters

The following parameters are available in the cassandra::dse class.

config_file

Data type: string

The full path to the DSE configuration file.

Default value: '/etc/dse/dse.yaml'

config_file_mode

Data type: string

The mode for the DSE configuration file.

Default value: '0644'

dse_yaml_tmpl

Data type: string

A path to a template for the dse.yaml file.

Default value: 'cassandra/dse.yaml.erb'

file_lines

Data type: hash

A hash of values that are passed to create_resources as a file_line resource.

Default value: undef

service_refresh

Data type: boolean

Whether or not the Cassandra service should be refreshed if the DSE configuration files are changed.

Default value: true

settings

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

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 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.

Parameters

The following parameters are available in the cassandra::firewall_ports class.

client_ports

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]

client_subnets

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']

inter_node_ports

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]

inter_node_subnets

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']

public_ports

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]

public_subnets

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']

ssh_port

Data type: integer

Which port does SSH operate on.

Default value: 22

opscenter_ports

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]

opscenter_subnets

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']

cassandra::java

A class to install Java and JNA packages.

Parameters

The following parameters are available in the cassandra::java class.

aptkey

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

aptsource

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

jna_ensure

Data type: string

Is passed to the package reference for the JNA package. Valid values are present or a version number.

Default value: present

jna_package_name

Data type: string

The name of the JNA package.

Default value: $cassandra::params::jna_package_name

package_ensure

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

package_name

Data type: string

The name of the Java package to be installed.

Default value: $cassandra::params::java_package

yumrepo

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

cassandra::optutils

A class to install the optional Cassandra tools package.

Parameters

The following parameters are available in the cassandra::optutils class.

package_ensure

Data type: string

Can be present, latest or a specific version number.

Default value: 'present'

package_name

Data type: string

The name of the optional utilities package to be installed.

Default value: $cassandra::params::optutils_package_name

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).

Parameters

The following parameters are available in the cassandra::schema class.

connection_tries

Data type: integer

How many times do try to connect to Cassandra. See also connection_try_sleep.

Default value: 6

connection_try_sleep

Data type: integer

How much time to allow between the number of tries specified in connection_tries.

Default value: 30

cql_types

Data type: hash

Creates new cassandra::schema::cql_type resources.

Default value: {}

cqlsh_additional_options

Data type: string

Any additional options to be passed to the cqlsh command.

Default value: ''

cqlsh_client_config

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

cqlsh_client_tmpl

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'

cqlsh_command

Data type: string

The full path to the cqlsh command.

Default value: '/usr/bin/cqlsh'

cqlsh_host

Data type: string

The host for the cqlsh command to connect to. See also cqlsh_port.

Default value: 'localhost'

cqlsh_password

Data type: string

If credentials are require for connecting, specify the password here. See also cqlsh_user, cqlsh_client_config.

Default value: undef

cqlsh_port

Data type: integer

The host for the cqlsh command to connect to. See also cqlsh_host.

Default value: 9042

cqlsh_user

Data type: string

If credentials are required for connecting, specify the password here. See also cqlsh_password, cqlsh_client_config

Default value: 'cassandra'

indexes

Data type: hash

Creates new cassandra::schema::index resources.

Default value: {}

keyspaces

Data type: hash

Creates new cassandra::schema::keyspace resources.

Default value: {}

permissions

Data type: hash

Creates new cassandra::schema::permission resources.

Default value: {}

tables

Data type: hash

Creates new cassandra::schema::table resources.

Default value: {}

users

Data type: hash

Creates new cassandra::schema::user resources.

Default value: {}

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::system::swapoff

Disable swap on the node as suggested at http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html

  • See also cassandra::params

Parameters

The following parameters are available in the cassandra::system::swapoff class.

device

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

mount

Data type: string

The name of the swap mount point. Ignored unless device has been set.

Default value: 'swap'

path

Data type: string

The full path to the file to check if swap is enabled.

Default value: '/proc/swaps'

cassandra::system::sysctl

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

Examples

Basic requirement
require cassandra::system::sysctl

Parameters

The following parameters are available in the cassandra::system::sysctl class.

sysctl_args

Data type: string

Passed to the sysctl command

Default value: '-p'

sysctl_file

Data type: string

Path to the file to insert the settings into.

Default value: $cassandra::params::sysctl_file

net_core_optmem_max

Data type: integer

The value to set for net.core.optmem_max

Default value: 40960

net_core_rmem_default

Data type: integer

The value to set for net.core.rmem_default.

Default value: 16777216

net_core_rmem_max

Data type: integer

The value to set for net_core_rmem_max.

Default value: 16777216

net_core_wmem_default

Data type: integer

The value to set for net.core.wmem_default.

Default value: 16777216

net_core_wmem_max

Data type: integer

The value to set for net.core.wmem_max.

Default value: 16777216

net_ipv4_tcp_rmem

Data type: string

The value to set for net.ipv4.tcp_rmem.

Default value: $cassandra::params::net_ipv4_tcp_rmem

net_ipv4_tcp_wmem

Data type: string

The value to set for net.ipv4.tcp_wmem.

Default value: $cassandra::params::net_ipv4_tcp_wmem

vm_max_map_count

Data type: integer

The value to set for vm.max_map_count.

Default value: 1048575

cassandra::system::transparent_hugepage

Disable Transparant Huge Pages as suggested in http://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html.

  • See also cassandra::params

Parameters

The following parameters are available in the cassandra::system::transparent_hugepage class.

path

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'

Defined types

cassandra::file

A defined type for altering files relative to the configuration directory.

Examples

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],
}

Parameters

The following parameters are available in the cassandra::file defined type.

file

Data type: string

The name of the file relative to the config_path.

Default value: $title

config_path

Data type: string

The path to the configuration directory.

Default value: $cassandra::config_path

file_lines

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

service_refresh

Data type: boolean

Is the Cassandra service is to be notified if the environment file is changed.

Default value: true

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 API provided by cassandra::firewall_ports instead) but is documented here for completeness.

Parameters

The following parameters are available in the cassandra::private::firewall_ports::rule defined type.

ports

Data type: integer

The number(s) of the port(s) to be opened.

cassandra::schema::cql_type

Create or drop user defined data types within the schema.

Examples

cassandra::schema::cql_type { 'fullname':
  keyspace => 'mykeyspace',
  fields   => {
    'fname' => 'text',
    'lname' => 'text',
  },
}

Parameters

The following parameters are available in the cassandra::schema::cql_type defined type.

keyspace

Data type: string

The name of the keyspace that the data type is to be associated with.

ensure

Data type: present|absent

ensure the data type is created, or is dropped.

Default value: present

fields

Data type: hash

A hash of the fields that will be components for the data type.

Default value: {}

cql_type_name

Data type: string

The name of the CQL type to be created.

Default value: $title

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::schema::index

Create or drop indexes within the schema.

Parameters

The following parameters are available in the cassandra::schema::index defined type.

ensure

Data type: present|absent

Create or dro[ the index.

Default value: present

class_name

Data type: string

The name of the class to be associated with an index when creating a custom index.

Default value: undef

index

Data type: string

The name of the index. Defaults to the name of the resource.

Default value: $title

keys

Data type: string

The columns that the index is being created on.

Default value: undef

keyspace

Data type: string

The name the keyspace that the index is to be associated with.

options

Data type: string

Any options to be added to the index.

Default value: undef

table

Data type: string

The name of the table that the index is to be associated with.

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::schema::keyspace

Create or drop keyspaces within the schema.

Examples

$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,
}

Parameters

The following parameters are available in the cassandra::schema::keyspace defined type.

ensure

Data type: present|absent

Create or drop the keyspace.

Default value: present

durable_writes

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

keyspace_name

Data type: string

The name of the keyspace to be created.

Default value: $title

replication_map

Data type: hash

Needed if the keyspace is to be present. Optional if it is to be absent.

Default value: {}

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::schema::permission

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.

Parameters

The following parameters are available in the cassandra::schema::permission defined type.

user_name

Data type: string

The name of the user who is to be granted or revoked.

ensure

Data type: present | absent

Set to present to grant a permission or absent to revoke it.

Default value: present

keyspace_name

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'

permission_name

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'

table_name

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

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::schema::table

Create or drop tables within the schema.

Examples

cassandra::schema::table { 'users':
  keyspace => 'mykeyspace',
  columns  => {
    'userid'      => 'int',
    'fname'       => 'text',
    'lname'       => 'text',
    'PRIMARY KEY' => '(userid)',
  },
}

Parameters

The following parameters are available in the cassandra::schema::table defined type.

keyspace

Data type: string

The name of the keyspace.

columns

Data type: hash

A hash of the columns to be placed in the table. Optional if the table is to be absent.

Default value: {}

ensure

Data type: present|absent

Ensure a keyspace is created or dropped.

Default value: present

options

Data type: array

Options to be added to the table creation.

Default value: []

table

Data type: string

The name of the table. Defaults to the name of the resource.

Default value: $title

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name

cassandra::schema::user

Create or drop users. To use this class, a suitable authenticator (e.g. PasswordAuthenticator) must be set in the Cassandra class.

Examples

cassandra::schema::user { 'akers':
  password  => 'Niner2',
  superuser => true,
}

cassandra::schema::user { 'lucan':
  ensure => absent,
}

Parameters

The following parameters are available in the cassandra::schema::user defined type.

ensure

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

password

Data type: string

A password for the user.

Default value: undef

superuser

Data type: boolean

If the user is to be a super-user on the system.

Default value: false

login

Data type: boolean

Allows the role to log in.

Default value: true

user_name

Data type: string

The name of the user.

Default value: $title

use_scl

Data type: Boolean

Default value: $cassandra::params::use_scl

scl_name

Data type: String[1]

Default value: $cassandra::params::scl_name