Composable roles within services - Redis
authorPradeep Kilambi <pkilambi@redhat.com>
Wed, 4 May 2016 19:38:25 +0000 (15:38 -0400)
committerCarlos Camacho <ccamacho@redhat.com>
Thu, 2 Jun 2016 15:26:01 +0000 (17:26 +0200)
Co-Authored-By: Carlos Camacho <ccamacho@redhat.com>
Change-Id: I0d9332f7f4f9116c5435d338a9c35d4fb3f512c6
Implements: blueprint composable-services-within-roles
Depends-On: I60493a3aa64e5136b763e8e2084d728f5f812f8a

environments/puppet-pacemaker.yaml
overcloud-resource-registry-puppet.yaml
overcloud.yaml
puppet/controller.yaml
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp
puppet/services/database/redis-base.yaml [new file with mode: 0644]
puppet/services/database/redis.yaml [new file with mode: 0644]
puppet/services/pacemaker/database/redis.yaml [new file with mode: 0644]

index 679b79c..614bd3a 100644 (file)
@@ -22,3 +22,4 @@ resource_registry:
   OS::TripleO::Services::RabbitMQ: ../puppet/services/pacemaker/rabbitmq.yaml
   OS::TripleO::Services::Loadbalancer: ../puppet/services/pacemaker/loadbalancer.yaml
   OS::TripleO::Services::Memcached: ../puppet/services/pacemaker/memcached.yaml
+  OS::TripleO::Services::Redis: ../puppet/services/pacemaker/database/redis.yaml
index 5a9d6e3..559caf8 100644 (file)
@@ -138,6 +138,7 @@ resource_registry:
   OS::TripleO::Services::SwiftProxy: puppet/services/swift-proxy.yaml
   OS::TripleO::Services::SaharaApi: puppet/services/sahara-api.yaml
   OS::TripleO::Services::SaharaEngine: puppet/services/sahara-engine.yaml
+  OS::TripleO::Services::Redis: puppet/services/database/redis.yaml
 
 parameter_defaults:
   EnablePackageInstall: false
index 82d7368..b73f7a1 100644 (file)
@@ -649,6 +649,7 @@ parameters:
       - OS::TripleO::Services::Loadbalancer
       - OS::TripleO::Services::Memcached
       - OS::TripleO::Services::SwiftProxy
+      - OS::TripleO::Services::Redis
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the Controllers.
index 62bb301..99613f6 100644 (file)
@@ -15,6 +15,8 @@ parameters:
     description: The password for the aodh services.
     type: string
     hidden: true
+  #TODO(composable Redis): Remove the Redis password param
+  #As is used by ceilometer
   CeilometerApiVirtualIP:
     type: string
     default: ''
@@ -516,8 +518,8 @@ parameters:
     description: Set rabbit subscriber port, change this if using SSL
     type: number
   RedisPassword:
+    description: The password for Redis
     type: string
-    description: The password to access the Redis service
     hidden: true
   RedisVirtualIP:
     type: string
@@ -1082,7 +1084,6 @@ resources:
               SUBNET: {get_attr: [NetIpMap, net_ip_subnet_map, {get_param: [ServiceNetMap, HorizonNetwork]}]}
         rabbitmq_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RabbitMqNetwork]}]}
         redis_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, RedisNetwork]}]}
-        redis_password: {get_param: RedisPassword}
         redis_vip: {get_param: RedisVirtualIP}
         sahara_api_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, SaharaApiNetwork]}]}
         memcached_network: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MemcachedNetwork]}]}
@@ -1412,9 +1413,6 @@ resources:
                 rabbitmq::erlang_cookie: {get_input: rabbit_cookie}
                 # Redis
                 redis::bind: {get_input: redis_network}
-                redis::requirepass: {get_input: redis_password}
-                redis::masterauth: {get_input: redis_password}
-                redis::sentinel_auth_pass: {get_input: redis_password}
                 redis_vip: {get_input: redis_vip}
                 # Firewall
                 tripleo::firewall::manage_firewall: {get_input: manage_firewall}
index 439036a..1057001 100644 (file)
@@ -61,25 +61,6 @@ if hiera('step') >= 2 {
     }
   }
 
-  # Redis
-  $redis_node_ips = 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
-    include ::tripleo::redis_notification
-  }
-
   if str2bool(hiera('enable_galera', true)) {
     $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
   } else {
index abe586f..fcefe93 100644 (file)
@@ -108,12 +108,6 @@ if hiera('step') >= 1 {
     }
   }
 
-  # Redis
-  class { '::redis' :
-    service_manage => false,
-    notify_service => false,
-  }
-
   # Galera
   if str2bool(hiera('enable_galera', true)) {
     $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
@@ -226,15 +220,6 @@ if hiera('step') >= 2 {
       require         => Class['::mysql::server'],
       before          => Exec['galera-ready'],
     }
-
-    pacemaker::resource::ocf { 'redis':
-      ocf_agent_name  => 'heartbeat:redis',
-      master_params   => '',
-      meta_params     => 'notify=true ordered=true interleave=true',
-      resource_params => 'wait_last_known_master=true',
-      require         => Class['::redis'],
-    }
-
   }
   $mysql_root_password = hiera('mysql::server::root_password')
   $mysql_clustercheck_password = hiera('mysql_clustercheck_password')
diff --git a/puppet/services/database/redis-base.yaml b/puppet/services/database/redis-base.yaml
new file mode 100644 (file)
index 0000000..77b3c9f
--- /dev/null
@@ -0,0 +1,21 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Redis service configured with Puppet
+
+parameters:
+  RedisPassword:
+    description: The password for Redis
+    type: string
+    hidden: true
+
+outputs:
+  role_data:
+    description: Role data for the redis role.
+    value:
+      config_settings:
+       redis::requirepass: {get_param: RedisPassword}
+       redis::masterauth: {get_param: RedisPassword}
+       redis::sentinel_auth_pass: {get_param: RedisPassword}
+       tripleo::loadbalancer::redis_password: {get_param: RedisPassword}
+
diff --git a/puppet/services/database/redis.yaml b/puppet/services/database/redis.yaml
new file mode 100644 (file)
index 0000000..2669592
--- /dev/null
@@ -0,0 +1,25 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Redis service configured with Puppet
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+
+resources:
+  RedisBase:
+    type: ./redis-base.yaml
+
+outputs:
+  role_data:
+    description: Role data for the redis role.
+    value:
+      config_settings:
+        map_merge:
+          - get_attr: [RedisBase, role_data, config_settings]
+      step_config: |
+        include ::tripleo::profile::base::database::redis
diff --git a/puppet/services/pacemaker/database/redis.yaml b/puppet/services/pacemaker/database/redis.yaml
new file mode 100644 (file)
index 0000000..0e46f8a
--- /dev/null
@@ -0,0 +1,28 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Redis service configured with Puppet
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+
+resources:
+  RedisBase:
+    type: ../../database/redis-base.yaml
+
+outputs:
+  role_data:
+    description: Role data for the Redis pacemaker role.
+    value:
+      config_settings:
+        map_merge:
+          - get_attr: [RedisBase, role_data, config_settings]
+          - tripleo::profile::pacemaker::database::redis::redis_vip: {get_input: redis_vip}
+            redis::service_manage: false
+            redis::notify_service: false
+      step_config: |
+        include ::tripleo::profile::pacemaker::database::redis