Puppet Class: cassandra::firewall_ports
- Defined in:
- manifests/firewall_ports.pp
Overview
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.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'manifests/firewall_ports.pp', line 31
class cassandra::firewall_ports (
$client_ports = [9042, 9160],
$client_subnets = ['0.0.0.0/0'],
$inter_node_ports = [7000, 7001, 7199],
$inter_node_subnets = ['0.0.0.0/0'],
$public_ports = [8888],
$public_subnets = ['0.0.0.0/0'],
$ssh_port = 22,
$opscenter_ports = [9042, 9160, 61620, 61621],
$opscenter_subnets = ['0.0.0.0/0'],
) {
# Public connections on any node.
$public_subnets_array = prefix($public_subnets, '200_Public_')
cassandra::private::firewall_ports::rule { $public_subnets_array:
ports => concat($public_ports, [$ssh_port]),
}
# If this is a Cassandra node.
if defined ( Class['::cassandra']) {
# Inter-node connections for Cassandra
$inter_node_subnets_array = prefix($inter_node_subnets, '210_InterNode_')
cassandra::private::firewall_ports::rule { $inter_node_subnets_array:
ports => $inter_node_ports,
}
# Client connections for Cassandra
$client_subnets_array = prefix($client_subnets, '220_Client_')
cassandra::private::firewall_ports::rule { $client_subnets_array:
ports => $client_ports,
}
}
# Connections for DataStax Agent
if defined ( Class['::cassandra::datastax_agent']) or defined ( Class['::cassandra::opscenter']) {
$opscenter_subnets_opc_agent = prefix($opscenter_subnets, '230_OpsCenter_')
cassandra::private::firewall_ports::rule { $opscenter_subnets_opc_agent:
ports => $opscenter_ports,
}
}
}
|