aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/network/contrail/analytics.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/network/contrail/analytics.pp')
-rw-r--r--manifests/network/contrail/analytics.pp331
1 files changed, 236 insertions, 95 deletions
diff --git a/manifests/network/contrail/analytics.pp b/manifests/network/contrail/analytics.pp
index 4359a43..e34c7e6 100644
--- a/manifests/network/contrail/analytics.pp
+++ b/manifests/network/contrail/analytics.pp
@@ -43,6 +43,21 @@
# String value.
# Defaults to hiera('contrail::admin_user')
#
+# [*api_server*]
+# (optional) IP address of api server
+# String value.
+# Defaults to hiera('contrail_config_vip')
+#
+# [*api_port*]
+# (optional) port of api server
+# String value.
+# Defaults to hiera('contrail::api_port')
+#
+# [*analytics_aaa_mode*]
+# (optional) analytics aaa mode parameter
+# String value.
+# Defaults to hiera('contrail::analytics_aaa_mode')
+#
# [*auth_host*]
# (optional) keystone server ip address
# String (IPv4) value.
@@ -53,11 +68,26 @@
# Integer value.
# Defaults to hiera('contrail::auth_port')
#
+# [*auth_port_ssl*]
+# (optional) keystone ssl port.
+# Integer value.
+# Defaults to hiera('contrail::auth_port_ssl')
+#
# [*auth_protocol*]
# (optional) authentication protocol.
# String value.
# Defaults to hiera('contrail::auth_protocol')
#
+# [*ca_file*]
+# (optional) ca file name
+# String value.
+# Defaults to hiera('contrail::service_certificate',false)
+#
+# [*cert_file*]
+# (optional) cert file name
+# String value.
+# Defaults to hiera('contrail::service_certificate',false)
+#
# [*cassandra_server_list*]
# (optional) List IPs+port of Cassandra servers
# Array of strings value.
@@ -76,7 +106,7 @@
# [*disc_server_ip*]
# (optional) IPv4 address of discovery server.
# String (IPv4) value.
-# Defaults to hiera('contrail::disc_server_ip')
+# Defaults to hiera('contrail_config_vip')
#
# [*disc_server_port*]
# (optional) port Discovery server listens on.
@@ -103,6 +133,31 @@
# String (IPv4) value + port
# Defaults to hiera('contrail::memcached_server')
#
+# [*public_vip*]
+# (optional) Public virtual IP address
+# String (IPv4) value
+# Defaults to hiera('public_virtual_ip')
+#
+# [*rabbit_server*]
+# (optional) IPv4 addresses of rabbit server.
+# Array of String (IPv4) value.
+# Defaults to hiera('rabbitmq_node_ips')
+#
+# [*rabbit_user*]
+# (optional) Rabbit user
+# String value.
+# Defaults to hiera('contrail::rabbit_user')
+#
+# [*rabbit_password*]
+# (optional) Rabbit password
+# String value.
+# Defaults to hiera('contrail::rabbit_password')
+#
+# [*rabbit_port*]
+# (optional) port of rabbit server
+# String value.
+# Defaults to hiera('contrail::rabbit_port')
+#
# [*redis_server*]
# (optional) IPv4 address of redis server.
# String (IPv4) value.
@@ -123,123 +178,209 @@
# Integer value.
# Defaults to 8081
#
+# [*step*]
+# (optional) Step stack is in
+# Integer value.
+# Defaults to hiera('step')
+#
# [*zk_server_ip*]
# (optional) List IPs+port of Zookeeper servers
# Array of strings value.
# Defaults to hiera('contrail::zk_server_ip')
#
class tripleo::network::contrail::analytics(
- $host_ip,
- $admin_password = hiera('contrail::admin_password'),
- $admin_tenant_name = hiera('contrail::admin_tenant_name'),
- $admin_token = hiera('contrail::admin_token'),
- $admin_user = hiera('contrail::admin_user'),
- $auth_host = hiera('contrail::auth_host'),
- $auth_port = hiera('contrail::auth_port'),
- $auth_protocol = hiera('contrail::auth_protocol'),
- $cassandra_server_list = hiera('contrail::cassandra_server_list'),
- $collector_http_server_port = 8089,
- $collector_sandesh_port = 8086,
- $disc_server_ip = hiera('contrail::disc_server_ip'),
- $disc_server_port = hiera('contrail::disc_server_port'),
- $http_server_port = 8090,
- $insecure = hiera('contrail::insecure'),
- $kafka_broker_list = hiera('contrail::kafka_broker_list'),
- $memcached_servers = hiera('contrail::memcached_server'),
- $redis_server = '127.0.0.1',
- $redis_server_port = 6379,
- $rest_api_ip = '0.0.0.0',
- $rest_api_port = 8081,
- $zk_server_ip = hiera('contrail::zk_server_ip'),
+ $step = hiera('step'),
+ $admin_password = hiera('contrail::admin_password'),
+ $admin_tenant_name = hiera('contrail::admin_tenant_name'),
+ $admin_token = hiera('contrail::admin_token'),
+ $admin_user = hiera('contrail::admin_user'),
+ $api_server = hiera('contrail_config_vip'),
+ $api_port = hiera('contrail::api_port'),
+ $auth_host = hiera('contrail::auth_host'),
+ $auth_port = hiera('contrail::auth_port'),
+ $auth_protocol = hiera('contrail::auth_protocol'),
+ $auth_port_ssl = hiera('contrail::auth_port_ssl'),
+ $analytics_aaa_mode = hiera('contrail::analytics_aaa_mode'),
+ $cassandra_server_list = hiera('contrail_analytics_database_node_ips'),
+ $ca_file = hiera('contrail::service_certificate',false),
+ $cert_file = hiera('contrail::service_certificate',false),
+ $collector_http_server_port = hiera('contrail::analytics::collector_http_server_port'),
+ $collector_sandesh_port = hiera('contrail::analytics::collector_sandesh_port'),
+ $disc_server_ip = hiera('contrail_config_vip'),
+ $disc_server_port = hiera('contrail::disc_server_port'),
+ $http_server_port = hiera('contrail::analytics::http_server_port'),
+ $host_ip = hiera('contrail::analytics::host_ip'),
+ $insecure = hiera('contrail::insecure'),
+ $kafka_broker_list = hiera('contrail_analytics_database_node_ips'),
+ $memcached_servers = hiera('contrail::memcached_server'),
+ $public_vip = hiera('public_virtual_ip'),
+ $rabbit_server = hiera('rabbitmq_node_ips'),
+ $rabbit_user = hiera('contrail::rabbit_user'),
+ $rabbit_password = hiera('contrail::rabbit_password'),
+ $rabbit_port = hiera('contrail::rabbit_port'),
+ $redis_server = hiera('contrail::analytics::redis_server'),
+ $redis_server_port = hiera('contrail::analytics::redis_server_port'),
+ $rest_api_ip = hiera('contrail::analytics::rest_api_ip'),
+ $rest_api_port = hiera('contrail::analytics::rest_api_port'),
+ $zk_server_ip = hiera('contrail_database_node_ips'),
)
{
- class {'::contrail::keystone':
- keystone_config => {
- 'KEYSTONE' => {
+ $cassandra_server_list_9042 = join([join($cassandra_server_list, ':9042 '),':9042'],'')
+ $kafka_broker_list_9092 = join([join($kafka_broker_list, ':9092 '),':9092'],'')
+ $rabbit_server_list_5672 = join([join($rabbit_server, ":${rabbit_port},"),":${rabbit_port}"],'')
+ $redis_config = "bind ${host_ip} 127.0.0.1"
+ $zk_server_ip_2181 = join([join($zk_server_ip, ':2181 '),':2181'],'')
+ $zk_server_ip_2181_comma = join([join($zk_server_ip, ':2181,'),':2181'],'')
+
+ if $auth_protocol == 'https' {
+ $keystone_config = {
'admin_password' => $admin_password,
'admin_tenant_name' => $admin_tenant_name,
- 'admin_token' => $admin_token,
'admin_user' => $admin_user,
'auth_host' => $auth_host,
- 'auth_port' => $auth_port,
+ 'auth_port' => $auth_port_ssl,
'auth_protocol' => $auth_protocol,
'insecure' => $insecure,
- 'memcached_servers' => $memcached_servers,
- },
- },
- } ->
- class {'::contrail::analytics':
- analytics_api_config => {
- 'DEFAULTS' => {
- 'cassandra_server_list' => $cassandra_server_list,
- 'host_ip' => $host_ip,
- 'http_server_port' => $http_server_port,
- 'redis_server' => $redis_server,
- 'rest_api_ip' => $rest_api_ip,
- 'rest_api_port' => $rest_api_port,
- },
- 'DISCOVERY' => {
- 'disc_server_ip' => $disc_server_ip,
- 'disc_server_port' => $disc_server_port,
- },
- 'REDIS' => {
- 'redis_server_port' => $redis_server_port,
- 'redis_query_port' => $redis_server_port,
- 'server' => $redis_server,
- },
- },
- collector_config => {
- 'DEFAULTS' => {
- 'cassandra_server_list' => $cassandra_server_list,
- 'disc_server_ip' => $disc_server_ip,
- 'hostip' => $host_ip,
- 'http_server_port' => $collector_http_server_port,
- 'kafka_broker_list' => $kafka_broker_list,
- 'zookeeper_server_list' => $zk_server_ip,
- },
- 'COLLECTOR' => {
- 'port' => $collector_sandesh_port,
+ 'certfile' => $cert_file,
+ 'cafile' => $ca_file,
+ }
+ $vnc_api_lib_config = {
+ 'auth' => {
+ 'AUTHN_SERVER' => $public_vip,
+ 'AUTHN_PORT' => $auth_port_ssl,
+ 'AUTHN_PROTOCOL' => $auth_protocol,
+ 'certfile' => $cert_file,
+ 'cafile' => $ca_file,
},
- 'DISCOVERY' => {
- 'port' => $disc_server_port,
- 'server' => $disc_server_ip,
+ }
+ } else {
+ $keystone_config = {
+ 'admin_password' => $admin_password,
+ 'admin_tenant_name' => $admin_tenant_name,
+ 'admin_user' => $admin_user,
+ 'auth_host' => $auth_host,
+ 'auth_port' => $auth_port,
+ 'auth_protocol' => $auth_protocol,
+ 'insecure' => $insecure,
+ }
+ $vnc_api_lib_config = {
+ 'auth' => {
+ 'AUTHN_SERVER' => $public_vip,
},
- 'REDIS' => {
- 'port' => $redis_server_port,
- 'server' => $redis_server,
+ }
+ }
+ if $step >= 3 {
+ class {'::contrail::analytics':
+ alarm_gen_config => {
+ 'DEFAULTS' => {
+ 'host_ip' => $host_ip,
+ 'kafka_broker_list' => $kafka_broker_list_9092,
+ 'rabbitmq_server_list' => $rabbit_server_list_5672,
+ 'rabbitmq_user' => $rabbit_user,
+ 'rabbitmq_password' => $rabbit_password,
+ 'zk_list' => $zk_server_ip_2181,
+ },
+ 'DISCOVERY' => {
+ 'disc_server_ip' => $disc_server_ip,
+ 'disc_server_port' => $disc_server_port,
+ },
},
- },
- query_engine_config => {
- 'DEFAULTS' => {
- 'cassandra_server_list' => $cassandra_server_list,
- 'hostip' => $host_ip,
+ analytics_nodemgr_config => {
+ 'DISCOVERY' => {
+ 'server' => $disc_server_ip,
+ 'port' => $disc_server_port,
+ },
},
- 'DISCOVERY' => {
- 'port' => $disc_server_port,
- 'server' => $disc_server_ip,
+ analytics_api_config => {
+ 'DEFAULTS' => {
+ 'api_server' => "${api_server}:${api_port}",
+ 'aaa_mode' => $analytics_aaa_mode,
+ 'cassandra_server_list' => $cassandra_server_list_9042,
+ 'host_ip' => $host_ip,
+ 'http_server_port' => $http_server_port,
+ 'rest_api_ip' => $rest_api_ip,
+ 'rest_api_port' => $rest_api_port,
+ },
+ 'DISCOVERY' => {
+ 'disc_server_ip' => $disc_server_ip,
+ 'disc_server_port' => $disc_server_port,
+ },
+ 'REDIS' => {
+ 'redis_server_port' => $redis_server_port,
+ 'redis_query_port' => $redis_server_port,
+ 'server' => $redis_server,
+ },
+ 'KEYSTONE' => $keystone_config,
},
- 'REDIS' => {
- 'port' => $redis_server_port,
- 'server' => $redis_server,
+ collector_config => {
+ 'DEFAULT' => {
+ 'cassandra_server_list' => $cassandra_server_list_9042,
+ 'hostip' => $host_ip,
+ 'http_server_port' => $collector_http_server_port,
+ 'kafka_broker_list' => $kafka_broker_list_9092,
+ 'zookeeper_server_list' => $zk_server_ip_2181_comma,
+ },
+ 'COLLECTOR' => {
+ 'port' => $collector_sandesh_port,
+ },
+ 'DISCOVERY' => {
+ 'port' => $disc_server_port,
+ 'server' => $disc_server_ip,
+ },
+ 'REDIS' => {
+ 'port' => $redis_server_port,
+ 'server' => $redis_server,
+ },
},
- },
- snmp_collector_config => {
- 'DEFAULTS' => {
- 'zk_server_ip' => $zk_server_ip,
+ query_engine_config => {
+ 'DEFAULT' => {
+ 'cassandra_server_list' => $cassandra_server_list_9042,
+ 'hostip' => $host_ip,
+ },
+ 'DISCOVERY' => {
+ 'port' => $disc_server_port,
+ 'server' => $disc_server_ip,
+ },
+ 'REDIS' => {
+ 'port' => $redis_server_port,
+ 'server' => $redis_server,
+ },
},
- 'DISCOVERY' => {
- 'disc_server_ip' => $disc_server_ip,
- 'disc_server_port' => $disc_server_port,
+ snmp_collector_config => {
+ 'DEFAULTS' => {
+ 'zookeeper' => $zk_server_ip_2181_comma,
+ },
+ 'DISCOVERY' => {
+ 'disc_server_ip' => $disc_server_ip,
+ 'disc_server_port' => $disc_server_port,
+ },
},
- },
- topology_config => {
- 'DEFAULTS' => {
- 'zk_server_ip' => $zk_server_ip,
+ redis_config => $redis_config,
+ topology_config => {
+ 'DEFAULTS' => {
+ 'zookeeper' => $zk_server_ip_2181_comma,
+ },
+ 'DISCOVERY' => {
+ 'disc_server_ip' => $disc_server_ip,
+ 'disc_server_port' => $disc_server_port,
+ },
},
- 'DISCOVERY' => {
- 'disc_server_ip' => $disc_server_ip,
- 'disc_server_port' => $disc_server_port,
+ vnc_api_lib_config => $vnc_api_lib_config,
+ keystone_config => {
+ 'KEYSTONE' => $keystone_config,
},
- },
+ }
+ }
+ if $step >= 5 {
+ class {'::contrail::analytics::provision_analytics':
+ api_address => $api_server,
+ api_port => $api_port,
+ analytics_node_address => $host_ip,
+ analytics_node_name => $::fqdn,
+ keystone_admin_user => $admin_user,
+ keystone_admin_password => $admin_password,
+ keystone_admin_tenant_name => $admin_tenant_name,
+ openstack_vip => $public_vip,
+ }
}
}