Set all RabbitMQ queues as mirrored when clustered
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index fef749c..8f6398f 100644 (file)
@@ -26,6 +26,12 @@ if !str2bool(hiera('enable_package_install', 'false')) {
 
 if hiera('step') >= 1 {
 
+  include ::tripleo::loadbalancer
+
+}
+
+if hiera('step') >= 2 {
+
   if count(hiera('ntp::servers')) > 0 {
     include ::ntp
   }
@@ -123,44 +129,45 @@ if hiera('step') >= 1 {
     cluster_nodes    => $rabbit_nodes,
     node_ip_address  => hiera('controller_host'),
   }
-
-  rabbitmq_vhost { '/':
-    provider => 'rabbitmqctl',
+  if $rabbit_cluster {
+    rabbitmq_policy { 'ha-all@/':
+      pattern    => '^(?!amq\.).*',
+      definition => {
+        'ha-mode'      => 'all',
+        'ha-sync-mode' => 'automatic',
+      },
+    }
   }
-  rabbitmq_user { ['nova','glance','neutron','cinder','ceilometer','heat']:
-    admin    => true,
-    password => hiera('rabbit_password'),
+  rabbitmq_vhost { '/':
     provider => 'rabbitmqctl',
   }
 
-  rabbitmq_user_permissions {[
-    'nova@/',
-    'glance@/',
-    'neutron@/',
-    'cinder@/',
-    'ceilometer@/',
-    'heat@/',
-  ]:
-    configure_permission => '.*',
-    write_permission     => '.*',
-    read_permission      => '.*',
-    provider             => 'rabbitmqctl',
-  }
-
   # pre-install swift here so we can build rings
   include ::swift
 
-  # don't install Ceph if FSID is not provided
-  if hiera('ceph::profile::params::fsid', false) {
+  $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
+  $enable_ceph = $cinder_enable_rbd_backend
+
+  if $enable_ceph {
     class { 'ceph::profile::params':
       mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
     }
     include ::ceph::profile::mon
   }
 
-} #END STEP 1
+  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') >= 2 {
+if hiera('step') >= 3 {
 
   include ::keystone
 
@@ -202,7 +209,6 @@ if hiera('step') >= 2 {
   include ::glance::backend::swift
 
   class { 'nova':
-    rabbit_hosts           => [hiera('controller_virtual_ip')],
     glance_api_servers     => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
   }
 
@@ -214,10 +220,7 @@ if hiera('step') >= 2 {
   include ::nova::vncproxy
   include ::nova::scheduler
 
-  class {'neutron':
-    rabbit_hosts => [hiera('controller_virtual_ip')],
-  }
-
+  include ::neutron
   include ::neutron::server
   include ::neutron::agents::dhcp
   include ::neutron::agents::l3
@@ -250,19 +253,57 @@ if hiera('step') >= 2 {
   Service['neutron-server'] -> Service['neutron-ovs-agent-service']
   Service['neutron-server'] -> Service['neutron-metadata']
 
-  class {'cinder':
-    rabbit_hosts => [hiera('controller_virtual_ip')],
-  }
-
+  include ::cinder
   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
@@ -327,4 +368,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