Perform basic setup of Pacemaker cluster using puppet-pacemaker
authorGiulio Fidente <gfidente@redhat.com>
Fri, 17 Apr 2015 18:19:36 +0000 (20:19 +0200)
committerGiulio Fidente <gfidente@redhat.com>
Mon, 20 Apr 2015 19:43:28 +0000 (15:43 -0400)
Depends-On: Ia1bbf53c674e34ba7c70249895b106ec0af3c249
Change-Id: Ifa9f579d26a3cba9f8705226984c7b987ae0ad1c

controller.yaml
overcloud-without-mergepy.yaml
puppet/controller-puppet.yaml
puppet/hieradata/controller.yaml
puppet/manifests/overcloud_controller.pp

index 4a21bac..4037fb0 100644 (file)
@@ -59,9 +59,6 @@ parameters:
     default: 'br-ex'
     description: Interface where virtual ip will be assigned.
     type: string
-  CorosyncAuthKey:
-    description: Auth encryption key for corosync
-    type: string
   Debug:
     default: ''
     description: Set to True to enable debugging on all services.
@@ -70,6 +67,11 @@ parameters:
     default: true
     description: Whether to use Galera instead of regular MariaDB.
     type: boolean
+  EnablePacemaker:
+    default: true
+    description: If enabled services will be monitored by Pacemaker; it
+      will manage VIPs as well, in place of Keepalived.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
@@ -305,6 +307,9 @@ parameters:
   NtpServer:
     type: string
     default: ''
+  PcsdPassword:
+    type: string
+    description: The password for the 'pcsd' user.
   PublicVirtualInterface:
     default: 'br-ex'
     description: >
index f61536c..32dc970 100644 (file)
@@ -263,6 +263,11 @@ parameters:
     default: true
     description: Whether to use Galera instead of regular MariaDB.
     type: boolean
+  EnablePacemaker:
+    default: true
+    description: If enabled services will be monitored by Pacemaker; it
+      will manage VIPs as well, in place of Keepalived.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
@@ -516,10 +521,10 @@ resources:
   HeatAuthEncryptionKey:
     type: OS::Heat::RandomString
 
-  CorosyncAuthKey:
+  PcsdPassword:
     type: OS::Heat::RandomString
     properties:
-      length: 128
+      length: 16
 
   Controller:
     type: OS::Heat::ResourceGroup
@@ -540,9 +545,9 @@ resources:
           CloudName: {get_param: CloudName}
           ControlVirtualInterface: {get_param: ControlVirtualInterface}
           ControllerExtraConfig: {get_param: controllerExtraConfig}
-          CorosyncAuthKey: {get_resource: CorosyncAuthKey}
           Debug: {get_param: Debug}
           EnableGalera: {get_param: EnableGalera}
+          EnablePacemaker: {get_param: EnablePacemaker}
           ExtraConfig: {get_param: ExtraConfig}
           Flavor: {get_param: OvercloudControlFlavor}
           GlancePort: {get_param: GlancePort}
@@ -583,6 +588,7 @@ resources:
           NeutronTunnelTypes: {get_param: NeutronTunnelTypes}
           NovaPassword: {get_param: NovaPassword}
           NtpServer: {get_param: NtpServer}
+          PcsdPassword: {get_resource: PcsdPassword}
           PublicVirtualInterface: {get_param: PublicVirtualInterface}
           RabbitPassword: {get_param: RabbitPassword}
           RabbitUserName: {get_param: RabbitUserName}
index c3efc82..007c710 100644 (file)
@@ -59,9 +59,6 @@ parameters:
     default: 'br-ex'
     description: Interface where virtual ip will be assigned.
     type: string
-  CorosyncAuthKey:
-    description: Auth encryption key for corosync
-    type: string
   Debug:
     default: ''
     description: Set to True to enable debugging on all services.
@@ -70,6 +67,11 @@ parameters:
     default: true
     description: Whether to use Galera instead of regular MariaDB.
     type: boolean
+  EnablePacemaker:
+    default: true
+    description: If enabled services will be monitored by Pacemaker; it
+      will manage VIPs as well, in place of Keepalived.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
@@ -309,6 +311,9 @@ parameters:
   NtpServer:
     type: string
     default: ''
+  PcsdPassword:
+    type: string
+    description: The password for the 'pcsd' user.
   PublicVirtualInterface:
     default: 'br-ex'
     description: >
@@ -436,7 +441,6 @@ resources:
         bootstack_nodeid: {get_attr: [Controller, name]}
         controller_host: {get_attr: [Controller, networks, ctlplane, 0]}
         controller_virtual_ip: {get_param: VirtualIP}
-        corosync_auth_key: {get_param: CorosyncAuthKey}
         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
         heat.watch_server_url:
           list_join:
@@ -516,6 +520,7 @@ resources:
               - {get_param: VirtualIP}
               - ':5000/v2.0/'
         enable_galera: {get_param: EnableGalera}
+        enable_pacemaker: {get_param: EnablePacemaker}
         mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
         mysql_root_password: {get_param: MysqlRootPassword}
         mysql_cluster_name:
@@ -569,6 +574,7 @@ resources:
             - - 'mysql://nova:unset@'
               - {get_param: VirtualIP}
               - '/nova'
+        pcsd_password: {get_param: PcsdPassword}
         rabbit_hosts:
           str_replace:
             template: '["host"]'
@@ -627,8 +633,8 @@ resources:
                 controller_host: {get_input: controller_host} #local-ipv4
 
                 # Pacemaker
-                corosync::authkey: {get_input: corosync_auth_key}
-                corosync::bind_address: {get_input: controller_host}
+                enable_pacemaker: {get_input: enable_pacemaker}
+                hacluster_pwd: {get_input: pcsd_password}
 
                 # Swift
                 swift::proxy::proxy_local_net_ip: {get_input: controller_host}
index 11ec5e2..d7e515a 100644 (file)
@@ -73,8 +73,8 @@ heat::engine::configure_delegated_roles: false
 heat::engine::trusts_delegated_roles: []
 
 # pacemaker
-corosync::authkey_source: 'string'
-corosync::multicast_address: broadcast
+pacemaker::corosync::cluster_name: 'tripleo_cluster'
+pacemaker::corosync::manage_fw: false
 
 mysql::server::manage_config_file: true
 
index 0d57dc6..08f9d42 100644 (file)
@@ -27,25 +27,33 @@ if !str2bool(hiera('enable_package_install', 'false')) {
 if hiera('step') >= 1 {
 
   $controller_node_ips = split(hiera('controller_node_ips'), ',')
+  $enable_pacemaker = str2bool(hiera('enable_pacemaker'))
+  $enable_keepalived = !$enable_pacemaker
+
   class { '::tripleo::loadbalancer' :
     controller_hosts => $controller_node_ips,
   }
 
-  class { '::corosync':
-    quorum_members => $controller_node_ips,
-  }
-  corosync::service { 'pacemaker':
-    version => '0',
-  }
-  service { 'pacemaker':
-    ensure  => running,
-    require => Service['corosync'],
-  }
-  cs_property { 'stonith-enabled':
-    value => 'false',
-  }
-  cs_property { 'no-quorum-policy':
-    value => 'ignore',
+  if $enable_pacemaker {
+    $pacemaker_cluster_members = regsubst(hiera('controller_node_ips'), ',', ' ', 'G')
+    if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+      $pacemaker_master = true
+    } else {
+      $pacemaker_master = false
+    }
+    user { 'hacluster':
+     ensure => present,
+    } ->
+    class { '::pacemaker':
+      hacluster_pwd => hiera('hacluster_pwd'),
+    } ->
+    class { '::pacemaker::corosync':
+      cluster_members => $pacemaker_cluster_members,
+      setup_cluster   => $pacemaker_master,
+    }
+    class { '::pacemaker::stonith':
+      disable => true,
+    }
   }
 
 }