Fixed typo in Dell Equallogic Cinder settings
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index 683c121..871e45c 100644 (file)
@@ -39,6 +39,8 @@ if hiera('step') >= 2 {
     include ::ntp
   }
 
+  include ::timezone
+
   # MongoDB
   if downcase(hiera('ceilometer_backend')) == 'mongodb' {
     include ::mongodb::globals
@@ -101,6 +103,7 @@ if hiera('step') >= 2 {
   include ::neutron::db::mysql
   include ::cinder::db::mysql
   include ::heat::db::mysql
+  include ::sahara::db::mysql
   if downcase(hiera('ceilometer_backend')) == 'mysql' {
     include ::ceilometer::db::mysql
   }
@@ -128,12 +131,13 @@ if hiera('step') >= 2 {
   # pre-install swift here so we can build rings
   include ::swift
 
-  $enable_ceph = hiera('ceph_storage_count', 0) > 0
+  $enable_ceph = hiera('ceph_storage_count', 0) > 0 or hiera('enable_ceph_storage', false)
 
   if $enable_ceph {
     class { '::ceph::profile::params':
       mon_initial_members => downcase(hiera('ceph_mon_initial_members')),
     }
+    include ::ceph::conf
     include ::ceph::profile::mon
   }
 
@@ -152,10 +156,12 @@ if hiera('step') >= 2 {
       } -> Class['ceph::profile::osd']
     }
 
+    include ::ceph::conf
     include ::ceph::profile::osd
   }
 
   if str2bool(hiera('enable_external_ceph', false)) {
+    include ::ceph::conf
     include ::ceph::profile::client
   }
 
@@ -164,13 +170,12 @@ if hiera('step') >= 2 {
 if hiera('step') >= 3 {
 
   include ::keystone
+  include ::keystone::config
   include ::keystone::roles::admin
   include ::keystone::endpoint
 
   #TODO: need a cleanup-keystone-tokens.sh solution here
-  keystone_config {
-    'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
-  }
+
   file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
     ensure  => 'directory',
     owner   => 'keystone',
@@ -211,6 +216,7 @@ if hiera('step') >= 3 {
 
   # TODO: notifications, scrubber, etc.
   include ::glance
+  include ::glance::config
   class { '::glance::api':
     known_stores => $glance_store,
   }
@@ -230,13 +236,62 @@ if hiera('step') >= 3 {
   include ::nova::scheduler
   include ::nova::scheduler::filter
 
-  include ::neutron
+  if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
+
+    # TODO(devvesa) provide non-controller ips for these services
+    $zookeeper_node_ips = hiera('neutron_api_node_ips')
+    $cassandra_node_ips = hiera('neutron_api_node_ips')
+
+    # Run zookeeper in the controller if configured
+    if hiera('enable_zookeeper_on_controller') {
+      class {'::tripleo::cluster::zookeeper':
+        zookeeper_server_ips => $zookeeper_node_ips,
+        zookeeper_client_ip  => $ipaddress,
+        zookeeper_hostnames  => hiera('controller_node_names')
+      }
+    }
+
+    # Run cassandra in the controller if configured
+    if hiera('enable_cassandra_on_controller') {
+      class {'::tripleo::cluster::cassandra':
+        cassandra_servers => $cassandra_node_ips,
+        cassandra_ip      => $ipaddress
+      }
+    }
+
+    class {'::tripleo::network::midonet::agent':
+      zookeeper_servers => $zookeeper_node_ips,
+      cassandra_seeds   => $cassandra_node_ips
+    }
+
+    class {'::tripleo::network::midonet::api':
+      zookeeper_servers    => $zookeeper_node_ips,
+      vip                  => $ipaddress,
+      keystone_ip          => $ipaddress,
+      keystone_admin_token => hiera('keystone::admin_token'),
+      bind_address         => $ipaddress,
+      admin_password       => hiera('admin_password')
+    }
+
+    # TODO: find a way to get an empty list from hiera
+    class {'::neutron':
+      service_plugins => []
+    }
+
+  }
+  else {
+
+    # ML2 plugin
+    include ::neutron
+  }
+
+  include ::neutron::config
   include ::neutron::server
   include ::neutron::server::notifications
 
   # If the value of core plugin is set to 'nuage',
-  # include nuage core plugin,
-  # else use the default value of 'ml2'
+  # include nuage core plugin, and it does not
+  # need the l3, dhcp and metadata agents
   if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' {
     include ::neutron::plugins::nuage
   } else {
@@ -252,55 +307,62 @@ if hiera('step') >= 3 {
       require => Package['neutron'],
     }
 
-    class { '::neutron::plugins::ml2':
-      flat_networks        => split(hiera('neutron_flat_networks'), ','),
-      tenant_network_types => [hiera('neutron_tenant_network_type')],
-      mechanism_drivers    => [hiera('neutron_mechanism_drivers')],
-    }
-    class { '::neutron::agents::ml2::ovs':
-      bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
-      tunnel_types    => split(hiera('neutron_tunnel_types'), ','),
-    }
-    if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
-      include ::neutron::plugins::ml2::cisco::nexus1000v
+    # If the value of core plugin is set to 'midonet',
+    # skip all the ML2 configuration
+    if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
 
-      class { '::neutron::agents::n1kv_vem':
-        n1kv_source  => hiera('n1kv_vem_source', undef),
-        n1kv_version => hiera('n1kv_vem_version', undef),
+      class {'::neutron::plugins::midonet':
+        midonet_api_ip    => $ipaddress,
+        keystone_tenant   => hiera('neutron::server::auth_tenant'),
+        keystone_password => hiera('neutron::server::auth_password')
       }
+    } else {
+
+      include ::neutron::plugins::ml2
+      include ::neutron::agents::ml2::ovs
+
+      if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
+        include ::neutron::plugins::ml2::cisco::nexus1000v
 
-      class { '::n1k_vsm':
-        n1kv_source       => hiera('n1kv_vsm_source', undef),
-        n1kv_version      => hiera('n1kv_vsm_version', undef),
-        pacemaker_control => false,
+        class { '::neutron::agents::n1kv_vem':
+          n1kv_source  => hiera('n1kv_vem_source', undef),
+          n1kv_version => hiera('n1kv_vem_version', undef),
+        }
+
+        class { '::n1k_vsm':
+          n1kv_source       => hiera('n1kv_vsm_source', undef),
+          n1kv_version      => hiera('n1kv_vsm_version', undef),
+          pacemaker_control => false,
+        }
       }
-    }
 
-    if 'cisco_ucsm' in hiera('neutron_mechanism_drivers') {
-      include ::neutron::plugins::ml2::cisco::ucsm
-    }
-    if 'cisco_nexus' in hiera('neutron_mechanism_drivers') {
-      include ::neutron::plugins::ml2::cisco::nexus
-      include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
-    }
+      if 'cisco_ucsm' in hiera('neutron::plugins::ml2::mechanism_drivers') {
+        include ::neutron::plugins::ml2::cisco::ucsm
+      }
+      if 'cisco_nexus' in hiera('neutron::plugins::ml2::mechanism_drivers') {
+        include ::neutron::plugins::ml2::cisco::nexus
+        include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
+      }
 
-    if hiera('neutron_enable_bigswitch_ml2', false) {
-      include ::neutron::plugins::ml2::bigswitch::restproxy
-    }
-    neutron_l3_agent_config {
-      'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
-    }
-    neutron_dhcp_agent_config {
-      'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
+      if hiera('neutron_enable_bigswitch_ml2', false) {
+        include ::neutron::plugins::ml2::bigswitch::restproxy
+      }
+      neutron_l3_agent_config {
+        'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
+      }
+      neutron_dhcp_agent_config {
+        'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
+      }
+      Service['neutron-server'] -> Service['neutron-ovs-agent-service']
     }
 
     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']
   }
 
   include ::cinder
+  include ::cinder::config
   include ::cinder::api
   include ::cinder::glance
   include ::cinder::scheduler
@@ -345,6 +407,48 @@ if hiera('step') >= 3 {
     }
   }
 
+  if hiera('cinder_enable_eqlx_backend', false) {
+    $cinder_eqlx_backend = hiera('cinder::backend::eqlx::volume_backend_name')
+
+    cinder_config {
+      "${cinder_eqlx_backend}/host": value => 'hostgroup';
+    }
+
+    cinder::backend::eqlx { $cinder_eqlx_backend :
+      volume_backend_name => hiera('cinder::backend::eqlx::volume_backend_name', undef),
+      san_ip              => hiera('cinder::backend::eqlx::san_ip', undef),
+      san_login           => hiera('cinder::backend::eqlx::san_login', undef),
+      san_password        => hiera('cinder::backend::eqlx::san_password', undef),
+      san_thin_provision  => hiera('cinder::backend::eqlx::san_thin_provision', undef),
+      eqlx_group_name     => hiera('cinder::backend::eqlx::eqlx_group_name', undef),
+      eqlx_pool           => hiera('cinder::backend::eqlx::eqlx_pool', undef),
+      eqlx_use_chap       => hiera('cinder::backend::eqlx::eqlx_use_chap', undef),
+      eqlx_chap_login     => hiera('cinder::backend::eqlx::eqlx_chap_login', undef),
+      eqlx_chap_password  => hiera('cinder::backend::eqlx::eqlx_san_password', undef),
+    }
+  }
+
+  if hiera('cinder_enable_dellsc_backend', false) {
+    $cinder_dellsc_backend = hiera('cinder::backend::dellsc_iscsi::volume_backend_name')
+
+    cinder_config {
+      "${cinder_dellsc_backend}/host": value => 'hostgroup';
+    }
+
+    cinder::backend::dellsc_iscsi{ $cinder_dellsc_backend :
+      volume_backend_name   => hiera('cinder::backend::dellsc_iscsi::volume_backend_name', undef),
+      san_ip                => hiera('cinder::backend::dellsc_iscsi::san_ip', undef),
+      san_login             => hiera('cinder::backend::dellsc_iscsi::san_login', undef),
+      san_password          => hiera('cinder::backend::dellsc_iscsi::san_password', undef),
+      dell_sc_ssn           => hiera('cinder::backend::dellsc_iscsi::dell_sc_ssn', undef),
+      iscsi_ip_address      => hiera('cinder::backend::dellsc_iscsi::iscsi_ip_address', undef),
+      iscsi_port            => hiera('cinder::backend::dellsc_iscsi::iscsi_port', undef),
+      dell_sc_port          => hiera('cinder::backend::dellsc_iscsi::dell_sc_port', undef),
+      dell_sc_server_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_server_folder', undef),
+      dell_sc_volume_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_volume_folder', undef),
+    }
+  }
+
   if hiera('cinder_enable_netapp_backend', false) {
     $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
 
@@ -398,7 +502,7 @@ if hiera('step') >= 3 {
     }
   }
 
-  $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_netapp_backend, $cinder_nfs_backend])
+  $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_eqlx_backend, $cinder_dellsc_backend, $cinder_netapp_backend, $cinder_nfs_backend])
   class { '::cinder::backends' :
     enabled_backends => $cinder_enabled_backends,
   }
@@ -461,13 +565,19 @@ if hiera('step') >= 3 {
 
   # Heat
   include ::heat
+  include ::heat::config
   include ::heat::api
   include ::heat::api_cfn
   include ::heat::api_cloudwatch
   include ::heat::engine
 
+  # Sahara
+  include ::sahara
+  include ::sahara::service::api
+  include ::sahara::service::engine
+
   # Horizon
-  if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
+  if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
     $_profile_support = 'cisco'
   } else {
     $_profile_support = 'None'
@@ -494,7 +604,19 @@ if hiera('step') >= 3 {
 } #END STEP 3
 
 if hiera('step') >= 4 {
-  include ::keystone::cron::token_flush
+  $keystone_enable_db_purge = hiera('keystone_enable_db_purge', true)
+  $nova_enable_db_purge = hiera('nova_enable_db_purge', true)
+  $cinder_enable_db_purge = hiera('cinder_enable_db_purge', true)
+
+  if $keystone_enable_db_purge {
+    include ::keystone::cron::token_flush
+  }
+  if $nova_enable_db_purge {
+    include ::nova::cron::archive_deleted_rows
+  }
+  if $cinder_enable_db_purge {
+    include ::cinder::cron::db_purge
+  }
 } #END STEP 4
 
 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])