From 3579b32fa2318a1fd0f1c9e0e2b5c1d1fbc1f184 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 25 Mar 2015 10:55:46 +0100 Subject: Add support for Redis configuration Add support for Redis configuration on the overcloud controller role. Change-Id: I917ff1e7c0abf9d76b9939a97978e858268deac2 Depends-On: I80a6c284af9eceb6b669a03c5d93256261523331 --- puppet/all-nodes-config.yaml | 4 ++++ puppet/controller-puppet.yaml | 3 ++- puppet/hieradata/controller.yaml | 6 ++++++ puppet/manifests/overcloud_controller.pp | 22 +++++++++++++++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) (limited to 'puppet') diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.yaml index 4d7af033..7a4df796 100644 --- a/puppet/all-nodes-config.yaml +++ b/puppet/all-nodes-config.yaml @@ -62,6 +62,10 @@ resources: list_join: - ',' - {get_param: controller_ips} + redis_node_ips: + list_join: + - ',' + - {get_param: controller_ips} outputs: config_id: diff --git a/puppet/controller-puppet.yaml b/puppet/controller-puppet.yaml index c3efc82e..a893186d 100644 --- a/puppet/controller-puppet.yaml +++ b/puppet/controller-puppet.yaml @@ -801,7 +801,8 @@ resources: # Rabbit rabbitmq::node_ip_address: {get_input: controller_host} rabbitmq::erlang_cookie: {get_input: rabbit_cookie} - + # Redis + redis::bind: {get_input: controller_host} # Misc memcached::listen_ip: {get_input: controller_host} neutron_public_interface_ip: {get_input: neutron_public_interface_ip} diff --git a/puppet/hieradata/controller.yaml b/puppet/hieradata/controller.yaml index 11ec5e27..0d15f4ea 100644 --- a/puppet/hieradata/controller.yaml +++ b/puppet/hieradata/controller.yaml @@ -13,6 +13,11 @@ rabbitmq::repos_ensure: false mongodb::server::replset: tripleo +redis::port: 6379 +redis::sentinel::master_name: "%{hiera('bootstrap_nodeid')}" +redis::sentinel::redis_host: "%{hiera('bootstrap_nodeid_ip')}" +redis::sentinel::notification_script: '/usr/local/bin/redis-notifications.sh' + # service tenant nova::api::admin_tenant_name: 'service' glance::api::keystone_tenant: 'service' @@ -90,6 +95,7 @@ tripleo::loadbalancer::nova_metadata: true tripleo::loadbalancer::nova_novncproxy: true tripleo::loadbalancer::mysql: true tripleo::loadbalancer::rabbitmq: true +tripleo::loadbalancer::redis: true tripleo::loadbalancer::swift_proxy_server: true tripleo::loadbalancer::ceilometer: true tripleo::loadbalancer::heat_api: true diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp index a6518c00..d37abad6 100644 --- a/puppet/manifests/overcloud_controller.pp +++ b/puppet/manifests/overcloud_controller.pp @@ -71,12 +71,32 @@ if hiera('step') >= 2 { } } + # Redis + $redis_node_ips = split(hiera('redis_node_ips'), ',') + $redis_master_hostname = downcase(hiera('bootstrap_nodeid')) + + if $redis_master_hostname == $::hostname { + $slaveof = undef + } else { + $slaveof = "${redis_master_hostname} 6379" + } + class {'::redis' : + slaveof => $slaveof, + } + + if count($redis_node_ips) > 1 { + Class['::tripleo::redis_notification'] -> Service['redis-sentinel'] + include ::redis::sentinel + class {'::tripleo::redis_notification' : + haproxy_monitor_ip => hiera('tripleo::loadbalancer::controller_virtual_ip'), + } + } + if str2bool(hiera('enable_galera', 'true')) { $mysql_config_file = '/etc/my.cnf.d/galera.cnf' } else { $mysql_config_file = '/etc/my.cnf.d/server.cnf' } - # TODO Galara class { 'mysql::server': config_file => $mysql_config_file, -- cgit 1.2.3-korg