lb: Allow multiple backend
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index 4801107..4269e03 100644 (file)
@@ -26,6 +26,15 @@ if !str2bool(hiera('enable_package_install', 'false')) {
 
 if hiera('step') >= 1 {
 
+  $controller_node_ips = split(downcase(hiera('controller_node_ips')), ',')
+  class { '::tripleo::loadbalancer' :
+    controller_hosts => $controller_node_ips,
+  }
+
+}
+
+if hiera('step') >= 2 {
+
   if count(hiera('ntp::servers')) > 0 {
     include ::ntp
   }
@@ -110,11 +119,18 @@ if hiera('step') >= 1 {
   Class['rabbitmq'] -> Rabbitmq_user <| |>
   Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
 
-  # TODO Rabbit HA
+  $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',')
+  if count($rabbit_nodes) > 1 {
+    $rabbit_cluster = true
+  }
+  else {
+    $rabbit_cluster = false
+  }
   class { 'rabbitmq':
-    package_provider  => $rabbit_provider,
-    config_cluster    => false,
-    node_ip_address   => hiera('controller_host'),
+    package_provider => $rabbit_provider,
+    config_cluster   => $rabbit_cluster,
+    cluster_nodes    => $rabbit_nodes,
+    node_ip_address  => hiera('controller_host'),
   }
 
   rabbitmq_vhost { '/':
@@ -143,9 +159,29 @@ if hiera('step') >= 1 {
   # pre-install swift here so we can build rings
   include ::swift
 
-} #END STEP 1
+  $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
+  $enable_ceph = $cinder_enable_rbd_backend
 
-if hiera('step') >= 2 {
+  if $enable_ceph {
+    class { 'ceph::profile::params':
+      mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
+    }
+    include ::ceph::profile::mon
+  }
+
+  if $cinder_enable_rbd_backend {
+    ceph::key { 'client.openstack' :
+      secret  => hiera('ceph::profile::params::mon_key'),
+      cap_mon => hiera('ceph_openstack_default_cap_mon'),
+      cap_osd => hiera('ceph_openstack_default_cap_osd'),
+      user    => 'cinder',
+      inject  => 'true',
+    }
+  }
+
+} #END STEP 2
+
+if hiera('step') >= 3 {
 
   include ::keystone
 
@@ -184,9 +220,7 @@ if hiera('step') >= 2 {
   # TODO: notifications, scrubber, etc.
   include ::glance::api
   include ::glance::registry
-  #class { 'glance::backend::swift':
-    #swift_store_auth_address => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
-  #}
+  include ::glance::backend::swift
 
   class { 'nova':
     rabbit_hosts           => [hiera('controller_virtual_ip')],
@@ -197,6 +231,7 @@ if hiera('step') >= 2 {
   include ::nova::cert
   include ::nova::conductor
   include ::nova::consoleauth
+  include ::nova::network::neutron
   include ::nova::vncproxy
   include ::nova::scheduler
 
@@ -231,32 +266,79 @@ if hiera('step') >= 2 {
     auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
   }
 
+  Service['neutron-server'] -> Service['neutron-dhcp-service']
+  Service['neutron-server'] -> Service['neutron-l3']
+  Service['neutron-server'] -> Service['neutron-ovs-agent-service']
+  Service['neutron-server'] -> Service['neutron-metadata']
+
   class {'cinder':
     rabbit_hosts => [hiera('controller_virtual_ip')],
   }
 
   include ::cinder::api
+  include ::cinder::glance
   include ::cinder::scheduler
   include ::cinder::volume
-  include ::cinder::volume::iscsi
   class {'cinder::setup_test_volume':
     size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
   }
 
+  $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
+  if $cinder_enable_iscsi {
+    $cinder_iscsi_backend = 'tripleo_iscsi'
+
+    cinder::backend::iscsi { $cinder_iscsi_backend :
+      iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
+      iscsi_helper     => hiera('cinder_iscsi_helper'),
+    }
+  }
+
+  if $enable_ceph {
+
+    Ceph_pool {
+      pg_num  => hiera('ceph::profile::params::osd_pool_default_pg_num'),
+      pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
+      size    => hiera('ceph::profile::params::osd_pool_default_size'),
+    }
+
+    $ceph_pools = hiera('ceph_pools')
+    ceph::pool { $ceph_pools : }
+  }
+
+  if $cinder_enable_rbd_backend {
+    $cinder_rbd_backend = 'tripleo_ceph'
+
+    cinder_config {
+      "${cinder_rbd_backend}/host": value => 'hostgroup';
+    }
+
+    cinder::backend::rbd { $cinder_rbd_backend :
+      rbd_pool        => 'volumes',
+      rbd_user        => 'openstack',
+      rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
+      require         => Ceph::Pool['volumes'],
+    }
+  }
+
+  $cinder_enabled_backends = concat(any2array($cinder_iscsi_backend), $cinder_rbd_backend)
+  class { '::cinder::backends' :
+    enabled_backends => $cinder_enabled_backends,
+  }
+
   # swift proxy
   include ::memcached
-  #include ::swift::proxy
-  #include ::swift::proxy::proxy_logging
-  #include ::swift::proxy::healthcheck
-  #include ::swift::proxy::cache
-  #include ::swift::proxy::keystone
-  #include ::swift::proxy::authtoken
-  #include ::swift::proxy::staticweb
-  #include ::swift::proxy::ceilometer
-  #include ::swift::proxy::ratelimit
-  #include ::swift::proxy::catch_errors
-  #include ::swift::proxy::tempurl
-  #include ::swift::proxy::formpost
+  include ::swift::proxy
+  include ::swift::proxy::proxy_logging
+  include ::swift::proxy::healthcheck
+  include ::swift::proxy::cache
+  include ::swift::proxy::keystone
+  include ::swift::proxy::authtoken
+  include ::swift::proxy::staticweb
+  include ::swift::proxy::ceilometer
+  include ::swift::proxy::ratelimit
+  include ::swift::proxy::catch_errors
+  include ::swift::proxy::tempurl
+  include ::swift::proxy::formpost
 
   # swift storage
   class {'swift::storage::all':
@@ -297,10 +379,6 @@ if hiera('step') >= 2 {
   include ::heat::api_cloudwatch
   include ::heat::engine
 
-  heat_config {
-    'DEFAULT/instance_user': value => 'heat-admin';
-  }
-
   $snmpd_user = hiera('snmpd_readonly_user_name')
   snmp::snmpv3_user { $snmpd_user:
     authtype => 'MD5',
@@ -311,4 +389,4 @@ if hiera('step') >= 2 {
     snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
   }
 
-} #END STEP 2
+} #END STEP 3