Add support for DeployArtifactURLs
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
index a84a534..14dde15 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'), ',')
 
@@ -39,6 +41,8 @@ if hiera('step') >= 2 {
     include ::ntp
   }
 
+  include ::timezone
+
   # MongoDB
   if downcase(hiera('ceilometer_backend')) == 'mongodb' {
     include ::mongodb::globals
@@ -81,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',
       },
@@ -98,9 +106,11 @@ 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
+  include ::sahara::db::mysql
   if downcase(hiera('ceilometer_backend')) == 'mysql' {
     include ::ceilometer::db::mysql
   }
@@ -128,12 +138,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 +163,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 +177,13 @@ if hiera('step') >= 2 {
 if hiera('step') >= 3 {
 
   include ::keystone
+  include ::keystone::config
   include ::keystone::roles::admin
   include ::keystone::endpoint
+  include ::keystone::wsgi::apache
 
   #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 +224,7 @@ if hiera('step') >= 3 {
 
   # TODO: notifications, scrubber, etc.
   include ::glance
+  include ::glance::config
   class { '::glance::api':
     known_stores => $glance_store,
   }
@@ -240,7 +254,8 @@ if hiera('step') >= 3 {
     if hiera('enable_zookeeper_on_controller') {
       class {'::tripleo::cluster::zookeeper':
         zookeeper_server_ips => $zookeeper_node_ips,
-        zookeeper_client_ip  => $ipaddress,
+        # TODO: create a 'bind' hiera key for zookeeper
+        zookeeper_client_ip  => hiera('neutron::bind_host'),
         zookeeper_hostnames  => hiera('controller_node_names')
       }
     }
@@ -249,7 +264,8 @@ if hiera('step') >= 3 {
     if hiera('enable_cassandra_on_controller') {
       class {'::tripleo::cluster::cassandra':
         cassandra_servers => $cassandra_node_ips,
-        cassandra_ip      => $ipaddress
+        # TODO: create a 'bind' hiera key for cassandra
+        cassandra_ip      => hiera('neutron::bind_host'),
       }
     }
 
@@ -260,10 +276,11 @@ if hiera('step') >= 3 {
 
     class {'::tripleo::network::midonet::api':
       zookeeper_servers    => $zookeeper_node_ips,
-      vip                  => $ipaddress,
-      keystone_ip          => $ipaddress,
+      vip                  => hiera('tripleo::loadbalancer::public_virtual_ip'),
+      keystone_ip          => hiera('tripleo::loadbalancer::public_virtual_ip'),
       keystone_admin_token => hiera('keystone::admin_token'),
-      bind_address         => $ipaddress,
+      # TODO: create a 'bind' hiera key for api
+      bind_address         => hiera('neutron::bind_host'),
       admin_password       => hiera('admin_password')
     }
 
@@ -279,6 +296,7 @@ if hiera('step') >= 3 {
     include ::neutron
   }
 
+  include ::neutron::config
   include ::neutron::server
   include ::neutron::server::notifications
 
@@ -305,7 +323,7 @@ if hiera('step') >= 3 {
     if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
 
       class {'::neutron::plugins::midonet':
-        midonet_api_ip    => $ipaddress,
+        midonet_api_ip    => hiera('tripleo::loadbalancer::public_virtual_ip'),
         keystone_tenant   => hiera('neutron::server::auth_tenant'),
         keystone_password => hiera('neutron::server::auth_password')
       }
@@ -337,8 +355,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);
@@ -355,6 +374,8 @@ if hiera('step') >= 3 {
   }
 
   include ::cinder
+  include ::cinder::config
+  include ::tripleo::ssl::cinder_config
   include ::cinder::api
   include ::cinder::glance
   include ::cinder::scheduler
@@ -399,12 +420,42 @@ if hiera('step') >= 3 {
     }
   }
 
-  if hiera('cinder_enable_netapp_backend', false) {
-    $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
+  if hiera('cinder_enable_eqlx_backend', false) {
+    $cinder_eqlx_backend = hiera('cinder::backend::eqlx::volume_backend_name')
+
+    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),
+    }
+  }
 
-    cinder_config {
-      "${cinder_netapp_backend}/host": value => 'hostgroup';
+  if hiera('cinder_enable_dellsc_backend', false) {
+    $cinder_dellsc_backend = hiera('cinder::backend::dellsc_iscsi::volume_backend_name')
+
+    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_api_port      => hiera('cinder::backend::dellsc_iscsi::dell_sc_api_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')
 
     if hiera('cinder::backend::netapp::nfs_shares', undef) {
       $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
@@ -452,7 +503,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,
   }
@@ -515,11 +566,17 @@ 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::plugins::ml2::mechanism_drivers') {
     $_profile_support = 'cisco'
@@ -548,7 +605,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')])