Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class nova::cell_v2::map_instances (
- $cell_uuid = undef,
- $cell_name = undef,
- $extra_params = '',
- ) {
- include ::nova::deps
- include ::nova::params
- if (!$cell_uuid and !$cell_name) {
- fail('Either cell_uuid or cell_name must be provided')
- }
- if ($cell_uuid) {
- $cell_uuid_real = $cell_uuid
- } else {
- # NOTE(aschultz): This is what breaks if you have multiple cells with the
- # same name. So that's why using cell_uuid is better.
- $cell_uuid_real = "$(nova-manage cell_v2 list_cells | sed -e '1,3d' -e '\$d' | awk -F ' *| *' '\$2 == \"${cell_name}\" {print \$4}')"
- }
- exec { 'nova-cell_v2-map_instances':
- path => ['/bin', '/usr/bin'],
- command => "nova-manage ${extra_params} cell_v2 map_instances --cell_uuid=${cell_uuid_real}",
- user => $::nova::params::nova_user,
- refreshonly => true,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement