Add support for Redis configuration
authorYanis Guenane <yanis.guenane@enovance.com>
Wed, 25 Mar 2015 09:55:46 +0000 (10:55 +0100)
committerYanis Guenane <yanis.guenane@enovance.com>
Thu, 16 Apr 2015 14:15:22 +0000 (16:15 +0200)
Add support for Redis  configuration on the overcloud controller role.

Change-Id: I917ff1e7c0abf9d76b9939a97978e858268deac2
Depends-On: I80a6c284af9eceb6b669a03c5d93256261523331

puppet/all-nodes-config.yaml
puppet/controller-puppet.yaml
puppet/hieradata/controller.yaml
puppet/manifests/overcloud_controller.pp

index 4d7af03..7a4df79 100644 (file)
@@ -62,6 +62,10 @@ resources:
                   list_join:
                   - ','
                   - {get_param: controller_ips}
+                redis_node_ips:
+                  list_join:
+                  - ','
+                  - {get_param: controller_ips}
 
 outputs:
   config_id:
index c3efc82..a893186 100644 (file)
@@ -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}
index 11ec5e2..0d15f4e 100644 (file)
@@ -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
index a6518c0..d37abad 100644 (file)
@@ -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,