Fixes puppet modules to come from Genesis repo 55/1355/2
authorTim Rozet <trozet@redhat.com>
Mon, 31 Aug 2015 14:36:27 +0000 (10:36 -0400)
committerTim Rozet <trozet@redhat.com>
Mon, 31 Aug 2015 21:47:17 +0000 (17:47 -0400)
This patch deprecates the use of puppet-trystack repo and migrates the
puppet modules even to Genesis.  deploy.sh now now copies the modules
from the current Genesis repo into foreman VM's /vagrant to be used
during install (rather than recloning).  Associated changes in
Khaleesi/QuickStack:
 - Khaleesi: commit 31b912778847f295d1459a71e5c41c808977c91d
 - Astapor: commit ac4be11e348d7bcff1e1aa28c96056e18dba5291

JIRA: APEX-8

Change-Id: I322ac797d1d687f17434e07e6775acef8961bdef
Signed-off-by: Tim Rozet <trozet@redhat.com>
common/puppet-opnfv/manifests/compute.pp
common/puppet-opnfv/manifests/controller_networker.pp
common/puppet-opnfv/manifests/external_net_presetup.pp
common/puppet-opnfv/manifests/templates/br_ex.erb [new file with mode: 0644]
foreman/ci/deploy.sh

index 0b81757..2fed241 100644 (file)
@@ -51,11 +51,11 @@ class opnfv::compute {
   if !$ceilometer_metering_secret { $ceilometer_metering_secret = $single_password }
 
   ##HA Global params
-  if $ha_flag {
+  if $ha_flag and str2bool($ha_flag) {
      if $private_network == '' { fail('private_network is empty') }
      if !$keystone_private_vip { fail('keystone_private_vip is empty') }
      if !$glance_private_vip { fail('glance_private_vip is empty') }
-     if !$nova_private_vip { fail('nova_private_vip is empty') }
+     if !$nova_public_vip { fail('nova_public_vip is empty') }
      if !$nova_db_password { $nova_db_password = $single_password }
      if !$nova_user_password { $nova_user_password = $single_password }
      if !$controllers_ip_array { fail('controllers_ip_array is empty') }
@@ -78,19 +78,30 @@ class opnfv::compute {
 
   } else {
   ##non HA params
-     if $ovs_tunnel_if == '' { fail('ovs_tunnel_if is empty') }
-     if !$private_ip { fail('private_ip is empty') }
-     $keystone_private_vip = $private_ip
-     $glance_private_vip   = $private_ip
-     $nova_private_vip     = $private_ip
-     $neutron_private_vip  = $private_ip
-     if !$nova_db_password { fail('nova_db_password is empty') }
-     if !$nova_user_password { fail('nova_user_password is empty') }
-     if !$odl_control_ip { $odl_control_ip = $private_ip }
-     if !$mysql_ip { $mysql_ip = $private_ip }
-     if !$amqp_ip { $amqp_ip = $private_ip }
-     if !$amqp_username { $amqp_username = 'guest' }
-     if !$amqp_password { $amqp_password = 'guest' }
+     ##Mandatory
+     if $private_network == '' { fail('private_network is empty') }
+     if ($odl_flag != '') and str2bool($odl_flag) {
+       if $odl_control_ip == '' { fail('odl_control_ip is empty') }
+     }
+     if $controller_ip == '' { fail('controller_ip is empty') }
+
+     ##Optional
+     ##Find private interface
+     $ovs_tunnel_if = get_nic_from_network("$private_network")
+     ##Find private ip
+     $private_ip = get_ip_from_nic("$ovs_tunnel_if")
+
+     $keystone_private_vip = $controller_ip
+     $glance_private_vip   = $controller_ip
+     $nova_public_vip      = $controller_ip
+     $neutron_private_vip  = $controller_ip
+
+     if !$nova_db_password { $nova_db_password = $single_password }
+     if !$nova_user_password { $nova_user_password = $single_password }
+     if !$mysql_ip { $mysql_ip = $controller_ip }
+     if !$amqp_ip { $amqp_ip = $controller_ip }
+     if !$amqp_username { $amqp_username = $single_username }
+     if !$amqp_password { $amqp_password = $single_password }
      if !$ceph_mon_host { $ceph_mon_host= ["$private_ip"] }
      if !$ceph_mon_initial_members { $ceph_mon_initial_members = ["$::hostname"] }
   }
@@ -103,7 +114,7 @@ class opnfv::compute {
     libvirt_inject_password      => 'false',
     libvirt_inject_key           => 'false',
     libvirt_images_type          => 'rbd',
-    nova_host                    => $nova_private_vip,
+    nova_host                    => $nova_public_vip,
     nova_db_password             => $nova_db_password,
     nova_user_password           => $nova_user_password,
     private_network              => '',
index b148ec8..60cae34 100644 (file)
@@ -329,50 +329,47 @@ class opnfv::controller_networker {
     }
 
   } else {
-    if $ovs_tunnel_if == '' { fail('ovs_tunnel_if is empty') }
-    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 $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') }
+    ##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,
@@ -427,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,
index b7c7c5f..96038c0 100644 (file)
@@ -85,7 +85,7 @@ class opnfv::external_net_presetup {
         owner   => 'root',
         group   => 'root',
         mode    => '0644',
-        content => template('trystack/br_ex.erb'),
+        content => template('opnfv/br_ex.erb'),
         before  => Class["quickstack::pacemaker::params"],
   }
   ->
diff --git a/common/puppet-opnfv/manifests/templates/br_ex.erb b/common/puppet-opnfv/manifests/templates/br_ex.erb
new file mode 100644 (file)
index 0000000..6c0e7e7
--- /dev/null
@@ -0,0 +1,10 @@
+DEVICE=br-ex
+DEVICETYPE=ovs
+IPADDR=<%= @public_nic_ip %>
+NETMASK=<%= @public_nic_netmask %>
+GATEWAY=<%= @public_gateway %>
+BOOTPROTO=static
+ONBOOT=yes
+TYPE=OVSBridge
+PROMISC=yes
+PEERDNS=no
index a05b3de..13ed641 100755 (executable)
@@ -415,20 +415,13 @@ clean_tmp() {
 }
 
 ##clone genesis and move to node vm dir
-##params: none
-##usage: clone_bgs
+##params: destination directory
+##usage: clone_bgs /tmp/myvm/
 clone_bgs() {
-  cd /tmp/
-  rm -rf /tmp/genesis/
-
-  ##clone artifacts and move into foreman_vm dir
-  if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/genesis.git; then
-    printf '%s\n' 'deploy.sh: Unable to clone genesis repo' >&2
-    exit 1
-  fi
-
-  mv -f /tmp/genesis/foreman/ci $vm_dir/foreman_vm
-  rm -rf /tmp/genesis/
+  script=`realpath $0`
+  script_dir="`dirname "$script"`"
+  cp -fr $script_dir/ $1
+  cp -fr $script_dir/../../common/puppet-opnfv $1
 }
 
 ##validates the network settings and update VagrantFile with network settings
@@ -911,13 +904,7 @@ start_virtual_nodes() {
       rm -rf /tmp/genesis/
 
       ##clone genesis and move into node folder
-      if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/genesis.git; then
-        printf '%s\n' 'deploy.sh: Unable to clone vagrant repo' >&2
-        exit 1
-      fi
-
-      mv -f /tmp/genesis/foreman/ci $vm_dir/$node
-      rm -rf /tmp/genesis/
+      clone_bgs $vm_dir/$node
 
       cd $vm_dir/$node
 
@@ -1118,7 +1105,7 @@ main() {
   install_vagrant
   clean_tmp
   verify_vm_dir
-  clone_bgs
+  clone_bgs $vm_dir/foreman_vm
   configure_network
   configure_virtual
   start_foreman