Merge "Restore the NtpServer parameter name"
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index 87776ea..985b3f0 100644 (file)
@@ -18,27 +18,10 @@ include ::tripleo::firewall
 
 $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 <| |>
-
-}
-
 if hiera('step') >= 2 {
 
-  if count(hiera('ntp::servers')) > 0 {
-    include ::ntp
-  }
-
-  include ::timezone
-
   # MongoDB
   if downcase(hiera('ceilometer_backend')) == 'mongodb' {
-    include ::mongodb::globals
-    include ::mongodb::client
-    include ::mongodb::server
     # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
     # without the brackets as 'members' argument for the 'mongodb_replset'
     # resource.
@@ -54,11 +37,6 @@ if hiera('step') >= 2 {
 
     $mongodb_replset = hiera('mongodb::server::replset')
     $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
-    if downcase(hiera('bootstrap_nodeid')) == $::hostname {
-      mongodb_replset { $mongodb_replset :
-        members => $mongo_node_ips_with_port_nobr,
-      }
-    }
   }
 
   if str2bool(hiera('enable_galera', true)) {
@@ -85,65 +63,13 @@ if hiera('step') >= 2 {
 
   # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
   # Create all the database schemas
-  include ::nova::db::mysql
-  include ::nova::db::mysql_api
-  include ::neutron::db::mysql
   if downcase(hiera('gnocchi_indexer_backend')) == 'mysql' {
     include ::gnocchi::db::mysql
   }
   if downcase(hiera('ceilometer_backend')) == 'mysql' {
     include ::ceilometer::db::mysql
-    include ::aodh::db::mysql
-  }
-
-  $enable_ceph = hiera('ceph_storage_count', 0) > 0 or hiera('enable_ceph_storage', false)
-
-  if $enable_ceph {
-    $mon_initial_members = downcase(hiera('ceph_mon_initial_members'))
-    if str2bool(hiera('ceph_ipv6', false)) {
-      $mon_host = hiera('ceph_mon_host_v6')
-    } else {
-      $mon_host = hiera('ceph_mon_host')
-    }
-    class { '::ceph::profile::params':
-      mon_initial_members => $mon_initial_members,
-      mon_host            => $mon_host,
-    }
-    include ::ceph::conf
-    include ::ceph::profile::mon
-  }
-
-  if str2bool(hiera('enable_ceph_storage', false)) {
-    if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
-      exec { 'set selinux to permissive on boot':
-        command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
-        onlyif  => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
-        path    => ['/usr/bin', '/usr/sbin'],
-      }
-
-      exec { 'set selinux to permissive':
-        command => 'setenforce 0',
-        onlyif  => "which setenforce && getenforce | grep -i 'enforcing'",
-        path    => ['/usr/bin', '/usr/sbin'],
-      } -> Class['ceph::profile::osd']
-    }
-
-    include ::ceph::conf
-    include ::ceph::profile::osd
-  }
-
-  if str2bool(hiera('enable_external_ceph', false)) {
-    if str2bool(hiera('ceph_ipv6', false)) {
-      $mon_host = hiera('ceph_mon_host_v6')
-    } else {
-      $mon_host = hiera('ceph_mon_host')
-    }
-    class { '::ceph::profile::params':
-      mon_host            => $mon_host,
-    }
-    include ::ceph::conf
-    include ::ceph::profile::client
   }
+  include ::aodh::db::mysql
 
 } #END STEP 2
 
@@ -160,12 +86,6 @@ if hiera('step') >= 4 {
     memcached_servers => $memcached_servers
   }
   include ::nova::config
-  include ::nova::api
-  include ::nova::consoleauth
-  include ::nova::network::neutron
-  include ::nova::vncproxy
-  include ::nova::scheduler
-  include ::nova::scheduler::filter
 
   if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
 
@@ -208,110 +128,23 @@ if hiera('step') >= 4 {
     }
 
     # TODO: find a way to get an empty list from hiera
+    # TODO: when doing the composable midonet plugin, don't forget to
+    # set service_plugins to an empty array in 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' or'opencontrail' or 'plumgrid',
-  # include nuage or opencontrail or plumgrid core plugins
-  # else use the default value of 'ml2'
-  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
-  }
-  elsif hiera('neutron::core_plugin') == 'networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2' {
-    class { '::neutron::plugins::plumgrid' :
-      connection                   => hiera('neutron::server::database_connection'),
-      controller_priv_host         => hiera('keystone_admin_api_vip'),
-      admin_password               => hiera('admin_password'),
-      metadata_proxy_shared_secret => hiera('nova::api::neutron_metadata_proxy_shared_secret'),
-    }
-  } else {
-
-    # 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::plugins::midonet':
-        midonet_api_ip    => hiera('public_virtual_ip'),
-        keystone_tenant   => hiera('neutron::server::auth_tenant'),
-        keystone_password => hiera('neutron::server::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 { '::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::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 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
-        include ::neutron::plugins::ml2::bigswitch::restproxy
-        include ::neutron::agents::bigswitch
-      }
-      Service['neutron-server'] -> Service['neutron-ovs-agent-service']
-    }
-
-    Service['neutron-server'] -> Service['neutron-metadata']
-  }
-
-  if $enable_ceph {
-    $ceph_pools = hiera('ceph_pools')
-    ceph::pool { $ceph_pools :
-      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'),
-    }
-  }
+  # 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' {
 
-  # swift storage
-  if str2bool(hiera('enable_swift_storage', true)) {
-    class { '::swift::storage::all':
-      mount_check => str2bool(hiera('swift_mount_check')),
-    }
-    if(!defined(File['/srv/node'])) {
-      file { '/srv/node':
-        ensure  => directory,
-        owner   => 'swift',
-        group   => 'swift',
-        require => Package['openstack-swift'],
-      }
+    class {'::neutron::plugins::midonet':
+      midonet_api_ip    => hiera('public_virtual_ip'),
+      keystone_tenant   => hiera('neutron::server::auth_tenant'),
+      keystone_password => hiera('neutron::server::password')
     }
-    $swift_components = ['account', 'container', 'object']
-    swift::storage::filter::recon { $swift_components : }
-    swift::storage::filter::healthcheck { $swift_components : }
   }
 
   # Ceilometer
@@ -341,11 +174,9 @@ if hiera('step') >= 4 {
 
   # Aodh
   class { '::aodh' :
-    database_connection => $ceilometer_database_connection,
+    database_connection => hiera('aodh_mysql_conn_string'),
   }
   include ::aodh::db::sync
-  # To manage the upgrade:
-  Exec['ceilometer-dbsync'] -> Exec['aodh-db-sync']
   include ::aodh::auth
   include ::aodh::api
   include ::aodh::wsgi::apache
@@ -361,7 +192,7 @@ if hiera('step') >= 4 {
   } else {
     $_profile_support = 'None'
   }
-  $neutron_options   = {'profile_support' => $_profile_support }
+  $neutron_options   = merge({'profile_support' => $_profile_support },hiera('horizon::neutron_options',undef))
 
   $memcached_ipv6 = hiera('memcached_ipv6', false)
   if $memcached_ipv6 {
@@ -395,16 +226,6 @@ if hiera('step') >= 4 {
       default: { fail('Unrecognized gnocchi_backend parameter.') }
   }
 
-  $snmpd_user = hiera('snmpd_readonly_user_name')
-  snmp::snmpv3_user { $snmpd_user:
-    authtype => 'MD5',
-    authpass => hiera('snmpd_readonly_user_password'),
-  }
-  class { '::snmp':
-    agentaddress => ['udp:161','udp6:[::1]:161'],
-    snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
-  }
-
   hiera_include('controller_classes')
 
 } #END STEP 4