Merge "Enable heat-manage purge_deleted cron job"
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index bb65cf4..81a33bb 100644 (file)
@@ -20,7 +20,9 @@ $enable_load_balancer = hiera('enable_load_balancer', true)
 
 if hiera('step') >= 1 {
 
+  create_resources(kmod::load, hiera('kernel_modules'), {})
   create_resources(sysctl::value, hiera('sysctl_settings'), {})
+  Exec <| tag == 'kmod::load' |>  -> Sysctl <| |>
 
   $controller_node_ips = split(hiera('controller_node_ips'), ',')
 
@@ -83,11 +85,15 @@ if hiera('step') >= 2 {
     $mysql_config_file = '/etc/my.cnf.d/server.cnf'
   }
   # TODO Galara
+  # FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1298671 we
+  # set bind-address to a hostname instead of an ip address; to move Mysql
+  # from internal_api on another network we'll have to customize both
+  # MysqlNetwork and ControllerHostnameResolveNetwork in ServiceNetMap
   class { '::mysql::server':
     config_file             => $mysql_config_file,
     override_options        => {
       'mysqld' => {
-        'bind-address'     => hiera('mysql_bind_host'),
+        'bind-address'     => $::hostname,
         'max_connections'  => hiera('mysql_max_connections'),
         'open_files_limit' => '-1',
       },
@@ -100,6 +106,7 @@ if hiera('step') >= 2 {
   include ::keystone::db::mysql
   include ::glance::db::mysql
   include ::nova::db::mysql
+  include ::nova::db::mysql_api
   include ::neutron::db::mysql
   include ::cinder::db::mysql
   include ::heat::db::mysql
@@ -173,6 +180,7 @@ if hiera('step') >= 3 {
   include ::keystone::config
   include ::keystone::roles::admin
   include ::keystone::endpoint
+  include ::keystone::wsgi::apache
 
   #TODO: need a cleanup-keystone-tokens.sh solution here
 
@@ -214,7 +222,7 @@ if hiera('step') >= 3 {
   $http_store = ['glance.store.http.Store']
   $glance_store = concat($http_store, $backend_store)
 
-  # TODO: notifications, scrubber, etc.
+  # TODO: scrubber and other additional optional features
   include ::glance
   include ::glance::config
   class { '::glance::api':
@@ -222,6 +230,10 @@ if hiera('step') >= 3 {
   }
   include ::glance::registry
   include join(['::glance::backend::', $glance_backend])
+  $rabbit_port = hiera('rabbitmq::port')
+  class { '::glance::notify::rabbitmq':
+    rabbit_hosts => suffix(hiera('rabbit_node_ips'), ":${rabbit_port}"),
+  }
 
   class { '::nova' :
     memcached_servers => suffix(hiera('memcache_node_ips'), ':11211'),
@@ -292,11 +304,13 @@ if hiera('step') >= 3 {
   include ::neutron::server
   include ::neutron::server::notifications
 
-  # If the value of core plugin is set to 'nuage',
-  # include nuage core plugin, and it does not
+  # If the value of core plugin is set to 'nuage' or 'opencontrail',
+  # include nuage or opencontrail core plugins, 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
+  } elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2' {
+    include ::neutron::plugins::opencontrail
   } else {
     include ::neutron::agents::l3
     include ::neutron::agents::dhcp
@@ -347,8 +361,9 @@ if hiera('step') >= 3 {
         include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
       }
 
-      if hiera('neutron_enable_bigswitch_ml2', false) {
+      if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
         include ::neutron::plugins::ml2::bigswitch::restproxy
+        include ::neutron::agents::bigswitch
       }
       neutron_l3_agent_config {
         'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
@@ -366,10 +381,12 @@ if hiera('step') >= 3 {
 
   include ::cinder
   include ::cinder::config
+  include ::tripleo::ssl::cinder_config
   include ::cinder::api
   include ::cinder::glance
   include ::cinder::scheduler
   include ::cinder::volume
+  include ::cinder::ceilometer
   class { '::cinder::setup_test_volume':
     size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
   }
@@ -413,10 +430,6 @@ 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),
@@ -424,7 +437,7 @@ if hiera('step') >= 3 {
       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_lpool', 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),
@@ -434,10 +447,6 @@ if hiera('step') >= 3 {
   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),
@@ -455,10 +464,6 @@ if hiera('step') >= 3 {
   if hiera('cinder_enable_netapp_backend', false) {
     $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
 
-    cinder_config {
-      "${cinder_netapp_backend}/host": value => 'hostgroup';
-    }
-
     if hiera('cinder::backend::netapp::nfs_shares', undef) {
       $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
     }
@@ -567,7 +572,9 @@ if hiera('step') >= 3 {
   Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
 
   # Heat
-  include ::heat
+  class { '::heat' :
+    notification_driver => 'messaging',
+  }
   include ::heat::config
   include ::heat::api
   include ::heat::api_cfn
@@ -610,6 +617,7 @@ if hiera('step') >= 4 {
   $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)
+  $heat_enable_db_purge = hiera('heat_enable_db_purge', true)
 
   if $keystone_enable_db_purge {
     include ::keystone::cron::token_flush
@@ -620,6 +628,9 @@ if hiera('step') >= 4 {
   if $cinder_enable_db_purge {
     include ::cinder::cron::db_purge
   }
+  if $heat_enable_db_purge {
+    include ::heat::cron::purge_deleted
+  }
 } #END STEP 4
 
 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])