Fixes puppet modules to come from Genesis repo
[genesis.git] / common / puppet-opnfv / manifests / controller_networker.pp
index 6888850..60cae34 100644 (file)
@@ -30,7 +30,6 @@ class opnfv::controller_networker {
 
   ##Mandatory Common variables
   if $admin_email == '' { fail('admin_email is empty') }
-  if $ovs_tunnel_if == '' { fail('ovs_tunnel_if is empty') }
 
   ##Most users will only care about a single user/password for all services
   ##so lets create one variable that can be used instead of separate usernames/passwords
@@ -73,7 +72,16 @@ class opnfv::controller_networker {
     if !$nova_admin_vip { fail('nova_admin_vip is empty') }
     if !$nova_private_vip { fail('nova_private_vip is empty') }
     if !$nova_public_vip { fail('nova_public_vip is empty') }
+    if $private_network == '' { fail('private_network is empty') }
+    if !$heat_admin_vip { fail('heat_admin_vip is empty') }
+    if !$heat_private_vip { fail('heat_private_vip is empty') }
+    if !$heat_public_vip { fail('heat_public_vip is empty') }
+    if !$heat_cfn_admin_vip { fail('heat_cfn_admin_vip is empty') }
+    if !$heat_cfn_private_vip { fail('heat_cfn_private_vip is empty') }
+    if !$heat_cfn_public_vip { fail('heat_cfn_public_vip is empty') }
 
+    ##Find private interface
+    $ovs_tunnel_if = get_nic_from_network("$private_network")
 
     ##Optional HA variables
     if !$amqp_username  { $amqp_username = $single_username }
@@ -91,18 +99,28 @@ class opnfv::controller_networker {
     if !$cluster_control_ip { $cluster_control_ip = $controllers_ip_array[0] }
     if !$horizon_secret { $horizon_secret = $single_password }
     if !$glance_db_password { $glance_db_password = $single_password }
+    if !$glance_user_password { $glance_user_password = $single_password }
     if !$keystone_db_password { $keystone_db_password = $single_password }
     if !$keystone_user_password { $keystone_user_password = $single_password }
     if !$lb_backend_server_addrs { $lb_backend_server_addrs = $controllers_ip_array }
     if !$lb_backend_server_names { $lb_backend_server_names = $controllers_hostnames_array }
     if !$neutron_db_password  { $neutron_db_password = $single_password }
     if !$neutron_user_password  { $neutron_user_password = $single_password }
+    if !$neutron_metadata_proxy_secret { $neutron_metadata_proxy_secret = $single_password }
     if !$nova_db_password { $nova_db_password = $single_password }
     if !$nova_user_password { $nova_user_password = $single_password }
     if !$pcmk_server_addrs {$pcmk_server_addrs = $controllers_ip_array}
     if !$pcmk_server_names {$pcmk_server_names = ["pcmk-${controllers_hostnames_array[0]}", "pcmk-${controllers_hostnames_array[1]}", "pcmk-${controllers_hostnames_array[2]}"] }
     if !$rbd_secret_uuid { $rbd_secret_uuid = '3b519746-4021-4f72-957e-5b9d991723be' }
-    if !$storage_iface { $storage_iface = $ovs_tunnel_if }
+    if !$heat_user_password  { $heat_user_password = $single_password }
+    if !$heat_db_password  { $heat_db_password = $single_password }
+    if !$heat_cfn_user_password  { $heat_cfn_user_password = $single_password }
+    if !$heat_auth_encryption_key  { $heat_auth_encryption_key = 'octopus1octopus1' }
+    if !$storage_network {
+          $storage_iface = $ovs_tunnel_if
+    } else {
+          $storage_iface = get_nic_from_network("$storage_network")
+    }
 
     ##we assume here that if not provided, the first controller is where ODL will reside
     ##this is fine for now as we will replace ODL with ODL HA when it is ready
@@ -113,6 +131,13 @@ class opnfv::controller_networker {
                       "$storage_iface",
                       "")
 
+    if ($external_network_flag != '') and str2bool($external_network_flag) {
+      class { "opnfv::external_net_presetup":
+        stage   => presetup,
+        require => Class['opnfv::repo'],
+      }
+    }
+
     class { "opnfv::ceph_deploy":
       fsid                     => $ceph_fsid,
       osd_pool_default_size    => $ceph_osd_pool_size,
@@ -153,14 +178,25 @@ class opnfv::controller_networker {
       glance_private_vip       => $glance_private_vip,
       glance_public_vip        => $glance_public_vip,
       glance_user_password     => $glance_user_password,
-      heat_cfn_enabled         => 'false',
+      heat_auth_encryption_key => $heat_auth_encryption_key,
+      heat_cfn_admin_vip       => $heat_cfn_admin_vip,
+      heat_cfn_private_vip     => $heat_cfn_private_vip,
+      heat_cfn_public_vip      => $heat_cfn_public_vip,
+      heat_cfn_user_password   => $heat_cfn_user_password,
+      heat_cloudwatch_enabled  => 'true',
+      heat_cfn_enabled         => 'true',
+      heat_db_password         => $heat_db_password,
+      heat_admin_vip           => $heat_admin_vip,
+      heat_private_vip         => $heat_private_vip,
+      heat_public_vip          => $heat_public_vip,
+      heat_user_password       => $heat_user_password,
       horizon_admin_vip        => $horizon_admin_vip,
       horizon_private_vip      => $horizon_private_vip,
       horizon_public_vip       => $horizon_public_vip,
       include_ceilometer       => 'false',
       include_cinder           => 'true',
       include_glance           => 'true',
-      include_heat             => 'false',
+      include_heat             => 'true',
       include_horizon          => 'true',
       include_keystone         => 'true',
       include_neutron          => 'true',
@@ -211,8 +247,8 @@ class opnfv::controller_networker {
       admin_password      =>  $admin_password,
       admin_token         =>  $keystone_admin_token,
       cinder              =>  'true',
-      heat                =>  'false',
-      heat_cfn            =>  'false',
+      heat                =>  'true',
+      heat_cfn            =>  'true',
       keystonerc          =>  'true',
       use_syslog          =>  'true',
       verbose             =>  'true',
@@ -240,7 +276,10 @@ class opnfv::controller_networker {
       volume          => true,
     }
     ->
-    class { "quickstack::pacemaker::heat": }
+    class { "quickstack::pacemaker::heat":
+      use_syslog      => true,
+      verbose         => true,
+    }
     ->
     class { "quickstack::pacemaker::constraints": }
 
@@ -263,6 +302,7 @@ class opnfv::controller_networker {
     class { "quickstack::pacemaker::neutron":
       agent_type               =>  $this_agent,
       enable_tunneling         =>  'true',
+      external_network_bridge  =>  'br-ex',
       ml2_mechanism_drivers    =>  $ml2_mech_drivers,
       ml2_network_vlan_ranges  =>  ["physnet1:10:50"],
       odl_controller_ip        =>  $odl_control_ip,
@@ -270,49 +310,66 @@ class opnfv::controller_networker {
       ovs_tunnel_iface         =>  $ovs_tunnel_if,
       ovs_tunnel_types         =>  ["vxlan"],
       verbose                  =>  'true',
+      neutron_conf_additional_params => { default_quota => 'default',
+                                      quota_network => '50',
+                                      quota_subnet => '50',
+                                      quota_port => 'default',
+                                      quota_security_group => '50',
+                                      quota_security_group_rule  => 'default',
+                                      quota_vip => 'default',
+                                      quota_pool => 'default',
+                                      quota_router => '50',
+                                      quota_floatingip => '100',
+                                      network_auto_schedule => 'default',
+                                    },
     }
 
-  } else {
-
-    if $public_ip == '' { fail('public_ip is empty') }
-    if $private_ip == '' { fail('private_ip is empty') }
-
-    if $odl_control_ip == '' { $odl_control_ip = $private_ip }
-
-    if $mysql_ip == '' { fail('mysql_ip is empty') }
-    if $mysql_root_password == '' { fail('mysql_root_password is empty') }
-    if $amqp_ip == '' { fail('amqp_ip is empty') }
-
-    if $memcache_ip == '' { fail('memcache_ip is empty') }
-    if $neutron_ip == '' { fail('neutron_ip is empty') }
-
-    if $keystone_db_password == '' { fail('keystone_db_password is empty') }
-
-    if $horizon_secret_key == '' { fail('horizon_secret_key is empty') }
-
-    if $nova_user_password == '' { fail('nova_user_password is empty') }
-    if $nova_db_password == '' { fail('nova_db_password is empty') }
-
-    if $cinder_user_password == '' { fail('cinder_user_password is empty') }
-    if $cinder_db_password == '' { fail('cinder_db_password is empty') }
-
-    if $glance_user_password == '' { fail('glance_user_password is empty') }
-    if $glance_db_password == '' { fail('glance_db_password is empty') }
-
-    if $neutron_user_password == '' { fail('neutron_user_password is empty') }
-    if $neutron_db_password == '' { fail('neutron_db_password is empty') }
-    if $neutron_metadata_shared_secret == '' { fail('neutron_metadata_shared_secret is empty') }
-
-    if $ceilometer_user_password == '' { fail('ceilometer_user_password is empty') }
-    if $ceilometer_metering_secret == '' { fail('ceilometer_user_password is empty') }
-
-    if $heat_user_password == '' { fail('heat_user_password is empty') }
-    if $heat_db_password == '' { fail('heat_db_password is empty') }
-    if $heat_auth_encrypt_key == '' { fail('heat_auth_encrypt_key is empty') }
+    if ($external_network_flag != '') and str2bool($external_network_flag) {
+      class { "opnfv::external_net_setup": }
+    }
 
-    if $swift_user_password == '' { fail('swift_user_password is empty') }
-    if $swift_shared_secret == '' { fail('swift_shared_secret is empty') }
-    if $swift_admin_password == '' { fail('swift_admin_password is empty') }
+  } else {
+    ##Mandatory Non-HA parameters
+    if $private_network == '' { fail('private_network is empty') }
+    if $public_network == '' { fail('public_network is empty') }
+
+    ##Optional Non-HA parameters
+    if !$amqp_username { $amqp_username = $single_username }
+    if !$amqp_password { $amqp_password = $single_password }
+    if !$mysql_root_password { $mysql_root_password = $single_password }
+    if !$keystone_db_password { $keystone_db_password = $single_password }
+    if !$horizon_secret_key { $horizon_secret_key = $single_password }
+    if !$nova_db_password { $nova_db_password = $single_password }
+    if !$nova_user_password { $nova_user_password = $single_password }
+    if !$cinder_db_password { $cinder_db_password = $single_password }
+    if !$cinder_user_password { $cinder_user_password = $single_password }
+    if !$glance_db_password { $glance_db_password = $single_password }
+    if !$glance_user_password { $glance_user_password = $single_password }
+    if !$neutron_db_password  { $neutron_db_password = $single_password }
+    if !$neutron_user_password  { $neutron_user_password = $single_password }
+    if !$neutron_metadata_shared_secret { $neutron_metadata_shared_secret = $single_password }
+    if !$ceilometer_user_password { $ceilometer_user_password = $single_password }
+    if !$ceilometer_metering_secret { $ceilometer_metering_secret = $single_password }
+    if !$heat_user_password  { $heat_user_password = $single_password }
+    if !$heat_db_password  { $heat_db_password = $single_password }
+    if !$heat_auth_encryption_key  { $heat_auth_encryption_key = 'octopus1octopus1' }
+    if !$swift_user_password { $swift_user_password = $single_password }
+    if !$swift_shared_secret { $swift_shared_secret = $single_password }
+    if !$swift_admin_password { $swift_admin_password = $single_password }
+
+    ##Find private interface
+    $ovs_tunnel_if = get_nic_from_network("$private_network")
+    ##Find private ip
+    $private_ip = get_ip_from_nic("$ovs_tunnel_if")
+    #Find public NIC
+    $public_nic = get_nic_from_network("$public_network")
+    $public_ip = get_ip_from_nic("$public_nic")
+
+    if !$mysql_ip { $mysql_ip = $private_ip }
+    if !$amqp_ip { $amqp_ip = $private_ip }
+    if !$memcache_ip { $memcache_ip = $private_ip }
+    if !$neutron_ip { $neutron_ip = $private_ip }
+    if !$odl_control_ip { $odl_control_ip = $private_ip }
 
     class { "quickstack::neutron::controller_networker":
       admin_email                   => $admin_email,
@@ -337,8 +394,8 @@ class opnfv::controller_networker {
       mysql_root_password           => $mysql_root_password,
       #amqp_provider                 => $amqp_provider,
       amqp_host                     => $amqp_ip,
-      amqp_username                 => 'guest',
-      amqp_password                 => 'guest',
+      amqp_username                 => $amqp_username,
+      amqp_password                 => $amqp_password,
       #amqp_nssdb_password           => $quickstack::params::amqp_nssdb_password,
 
       keystone_admin_token          => $keystone_admin_token,
@@ -367,6 +424,8 @@ class opnfv::controller_networker {
       horizon_cert                  => $quickstack::params::horizon_cert,
       horizon_key                   => $quickstack::params::horizon_key,
 
+      keystonerc                    => true,
+
       ml2_mechanism_drivers         => $ml2_mech_drivers,
 
       #neutron                       => true,