SHARE
TWEET

Untitled

a guest Nov 22nd, 2018 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class nova::cell_v2::map_instances (
  2.   $cell_uuid    = undef,
  3.   $cell_name    = undef,
  4.   $extra_params = '',
  5. ) {
  6.  
  7.   include ::nova::deps
  8.   include ::nova::params
  9.  
  10.   if (!$cell_uuid and !$cell_name) {
  11.     fail('Either cell_uuid or cell_name must be provided')
  12.   }
  13.  
  14.   if ($cell_uuid) {
  15.     $cell_uuid_real = $cell_uuid
  16.   } else {
  17.     # NOTE(aschultz): This is what breaks if you have multiple cells with the
  18.     # same name. So that's why using cell_uuid is better.
  19.     $cell_uuid_real = "$(nova-manage cell_v2 list_cells | sed -e '1,3d' -e '\$d' | awk -F ' *| *' '\$2 == \"${cell_name}\" {print \$4}')"
  20.   }
  21.  
  22.   exec { 'nova-cell_v2-map_instances':
  23.     path        => ['/bin', '/usr/bin'],
  24.     command     => "nova-manage ${extra_params} cell_v2 map_instances --cell_uuid=${cell_uuid_real}",
  25.     user        => $::nova::params::nova_user,
  26.     refreshonly => true,
  27.   }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top