Enable nova service by default

This commit updates the default value for enable for nova components to
default to true, instead of false. Without this
change the nova service is not enabled by default resulting in a
different behavior than with other puppet openstack modules.
Associated tests are updated to expect the change in defaults.

Co-Authored-By: Cody Herriges <cody@puppetlabs.com>
Change-Id: I49fc84f9fedfe00d7846441e1b49334abb09e0eb
Closes-bug: #1220473
This commit is contained in:
kirby@puppetlabs.com
2015-05-20 11:02:10 -07:00
committed by Cody Herriges
parent bf7db41d20
commit 895e057abb
22 changed files with 91 additions and 110 deletions

View File

@@ -9,7 +9,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether the nova api service will be run # (optional) Whether the nova api service will be run
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -148,7 +148,7 @@
# #
class nova::api( class nova::api(
$admin_password, $admin_password,
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$auth_uri = false, $auth_uri = false,

View File

@@ -24,7 +24,7 @@
# #
# [*enabled*] # [*enabled*]
# Use Nova Cells or not # Use Nova Cells or not
# Defaults to 'False' # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -150,7 +150,7 @@ class nova::cells (
$create_cells = true, $create_cells = true,
$db_check_interval = '60', $db_check_interval = '60',
$driver = 'nova.cells.rpc_driver.CellsRPCDriver', $driver = 'nova.cells.rpc_driver.CellsRPCDriver',
$enabled = false, $enabled = true,
$ensure_package = 'present', $ensure_package = 'present',
$instance_updated_at_threshold = '3600', $instance_updated_at_threshold = '3600',
$instance_update_num_instances = '1', $instance_update_num_instances = '1',

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether or not to enable the nova cert service # (optional) Whether or not to enable the nova cert service
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -17,7 +17,7 @@
# Defaults to 'present' # Defaults to 'present'
# #
class nova::cert( class nova::cert(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present' $ensure_package = 'present'
) { ) {

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether to enable the nova-compute service # (optional) Whether to enable the nova-compute service
# Defaults to false # Defaults to true
# #
# [*heal_instance_info_cache_interval*] # [*heal_instance_info_cache_interval*]
# (optional) Controls how often the instance info should be updated. # (optional) Controls how often the instance info should be updated.
@@ -112,7 +112,7 @@
# { 'vendor_id':'4321','product_id':'8765','physical_network':'default' } ] " # { 'vendor_id':'4321','product_id':'8765','physical_network':'default' } ] "
# #
class nova::compute ( class nova::compute (
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$vnc_enabled = true, $vnc_enabled = true,

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether to enable the nova-conductor service # (optional) Whether to enable the nova-conductor service
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -21,7 +21,7 @@
# Defaults to undef (i.e. parameter will not be present) # Defaults to undef (i.e. parameter will not be present)
# #
class nova::conductor( class nova::conductor(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$workers = undef, $workers = undef,

View File

@@ -9,7 +9,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether the nova consoleauth service will be run # (optional) Whether the nova consoleauth service will be run
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -20,7 +20,7 @@
# Defaults to 'present' # Defaults to 'present'
# #
class nova::consoleauth( class nova::consoleauth(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present' $ensure_package = 'present'
) { ) {

View File

@@ -33,7 +33,7 @@
define nova::generic_service( define nova::generic_service(
$package_name, $package_name,
$service_name, $service_name,
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present' $ensure_package = 'present'
) { ) {

View File

@@ -36,7 +36,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether the network service should be enabled. # (optional) Whether the network service should be enabled.
# Defaults to false # Defaults to true
# #
# [*network_manager*] # [*network_manager*]
# (optional) The type of network manager to use. # (optional) The type of network manager to use.
@@ -66,7 +66,7 @@ class nova::network(
$num_networks = 1, $num_networks = 1,
$network_size = 255, $network_size = 255,
$floating_range = false, $floating_range = false,
$enabled = false, $enabled = true,
$network_manager = 'nova.network.manager.FlatDHCPManager', $network_manager = 'nova.network.manager.FlatDHCPManager',
$config_overrides = {}, $config_overrides = {},
$create_networks = true, $create_networks = true,

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether to enable the service # (optional) Whether to enable the service
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -21,7 +21,7 @@
# Defaults to '0.0.0.0' # Defaults to '0.0.0.0'
# #
class nova::objectstore( class nova::objectstore(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$bind_address = '0.0.0.0' $bind_address = '0.0.0.0'

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether to run the scheduler service # (optional) Whether to run the scheduler service
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -21,7 +21,7 @@
# Defaults to 'nova.scheduler.filter_scheduler.FilterScheduler' # Defaults to 'nova.scheduler.filter_scheduler.FilterScheduler'
# #
class nova::scheduler( class nova::scheduler(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$ensure_package = 'present', $ensure_package = 'present',
$scheduler_driver = 'nova.scheduler.filter_scheduler.FilterScheduler', $scheduler_driver = 'nova.scheduler.filter_scheduler.FilterScheduler',

View File

@@ -10,7 +10,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) enable spicehtml5proxy service # (optional) enable spicehtml5proxy service
# true/false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -29,7 +29,7 @@
# Defaults to 'present' # Defaults to 'present'
# #
class nova::spicehtml5proxy( class nova::spicehtml5proxy(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$host = '0.0.0.0', $host = '0.0.0.0',
$port = '6082', $port = '6082',

View File

@@ -6,7 +6,7 @@
# #
# [*enabled*] # [*enabled*]
# (optional) Whether to run the vncproxy service # (optional) Whether to run the vncproxy service
# Defaults to false # Defaults to true
# #
# [*manage_service*] # [*manage_service*]
# (optional) Whether to start/stop the service # (optional) Whether to start/stop the service
@@ -34,7 +34,7 @@
# Defaults to '/vnc_auto.html' # Defaults to '/vnc_auto.html'
# #
class nova::vncproxy( class nova::vncproxy(
$enabled = false, $enabled = true,
$manage_service = true, $manage_service = true,
$vncproxy_protocol = 'http', $vncproxy_protocol = 'http',
$host = '0.0.0.0', $host = '0.0.0.0',

View File

@@ -94,26 +94,22 @@ describe 'basic nova' do
password => 'a_big_secret', password => 'a_big_secret',
} }
class { '::nova::api': class { '::nova::api':
enabled => true,
admin_password => 'a_big_secret', admin_password => 'a_big_secret',
identity_uri => 'http://127.0.0.1:35357/', identity_uri => 'http://127.0.0.1:35357/',
osapi_v3 => true, osapi_v3 => true,
} }
class { '::nova::cert': enabled => true } class { '::nova::cert': }
class { '::nova::client': } class { '::nova::client': }
class { '::nova::conductor': enabled => true } class { '::nova::conductor': }
class { '::nova::consoleauth': enabled => true } class { '::nova::consoleauth': }
class { '::nova::cron::archive_deleted_rows': } class { '::nova::cron::archive_deleted_rows': }
class { '::nova::compute': class { '::nova::compute': vnc_enabled => true }
enabled => true,
vnc_enabled => true,
}
class { '::nova::compute::libvirt': class { '::nova::compute::libvirt':
migration_support => true, migration_support => true,
vncserver_listen => '0.0.0.0', vncserver_listen => '0.0.0.0',
} }
class { '::nova::scheduler': enabled => true } class { '::nova::scheduler': }
class { '::nova::vncproxy': enabled => true } class { '::nova::vncproxy': }
# TODO: networking with neutron # TODO: networking with neutron
EOS EOS

View File

@@ -21,9 +21,9 @@ describe 'nova::api' do
it 'installs nova-api package and service' do it 'installs nova-api package and service' do
is_expected.to contain_service('nova-api').with( is_expected.to contain_service('nova-api').with(
:name => platform_params[:nova_api_service], :name => platform_params[:nova_api_service],
:ensure => 'stopped', :ensure => 'running',
:hasstatus => true, :hasstatus => true,
:enable => false :enable => true
) )
is_expected.to contain_package('nova-api').with( is_expected.to contain_package('nova-api').with(
:name => platform_params[:nova_api_package], :name => platform_params[:nova_api_package],
@@ -78,7 +78,7 @@ describe 'nova::api' do
context 'with overridden parameters' do context 'with overridden parameters' do
before do before do
params.merge!({ params.merge!({
:enabled => true, :enabled => false,
:ensure_package => '2012.1-2', :ensure_package => '2012.1-2',
:auth_host => '10.0.0.1', :auth_host => '10.0.0.1',
:auth_port => 1234, :auth_port => 1234,
@@ -111,9 +111,9 @@ describe 'nova::api' do
) )
is_expected.to contain_service('nova-api').with( is_expected.to contain_service('nova-api').with(
:name => platform_params[:nova_api_service], :name => platform_params[:nova_api_service],
:ensure => 'running', :ensure => 'stopped',
:hasstatus => true, :hasstatus => true,
:enable => true :enable => false
) )
end end

View File

@@ -13,9 +13,9 @@ describe 'nova::compute' do
it 'installs nova-compute package and service' do it 'installs nova-compute package and service' do
is_expected.to contain_service('nova-compute').with({ is_expected.to contain_service('nova-compute').with({
:name => platform_params[:nova_compute_service], :name => platform_params[:nova_compute_service],
:ensure => 'stopped', :ensure => 'running',
:hasstatus => true, :hasstatus => true,
:enable => false :enable => true
}) })
is_expected.to contain_package('nova-compute').with({ is_expected.to contain_package('nova-compute').with({
:name => platform_params[:nova_compute_package], :name => platform_params[:nova_compute_package],
@@ -47,7 +47,7 @@ describe 'nova::compute' do
context 'with overridden parameters' do context 'with overridden parameters' do
let :params do let :params do
{ :enabled => true, { :enabled => false,
:ensure_package => '2012.1-2', :ensure_package => '2012.1-2',
:vncproxy_host => '127.0.0.1', :vncproxy_host => '127.0.0.1',
:network_device_mtu => 9999, :network_device_mtu => 9999,
@@ -65,9 +65,9 @@ describe 'nova::compute' do
it 'installs nova-compute package and service' do it 'installs nova-compute package and service' do
is_expected.to contain_service('nova-compute').with({ is_expected.to contain_service('nova-compute').with({
:name => platform_params[:nova_compute_service], :name => platform_params[:nova_compute_service],
:ensure => 'running', :ensure => 'stopped',
:hasstatus => true, :hasstatus => true,
:enable => true :enable => false
}) })
is_expected.to contain_package('nova-compute').with({ is_expected.to contain_package('nova-compute').with({
:name => platform_params[:nova_compute_package], :name => platform_params[:nova_compute_package],

View File

@@ -6,10 +6,6 @@ describe 'nova::conductor' do
'include nova' 'include nova'
end end
let :params do
{ :enabled => true }
end
shared_examples 'nova-conductor' do shared_examples 'nova-conductor' do
@@ -44,8 +40,8 @@ describe 'nova::conductor' do
end end
context 'with overriden workers parameter' do context 'with overriden workers parameter' do
before do let :params do
params.merge!({:workers => '5' }) {:workers => '5' }
end end
it { is_expected.to contain_nova_config('conductor/workers').with_value('5') } it { is_expected.to contain_nova_config('conductor/workers').with_value('5') }
end end

View File

@@ -34,9 +34,6 @@ describe 'nova::network' do
) } ) }
describe 'with enabled as true' do describe 'with enabled as true' do
let :params do
default_params.merge(:enabled => true)
end
it { is_expected.to contain_service('nova-network').with( it { is_expected.to contain_service('nova-network').with(
'name' => 'nova-network', 'name' => 'nova-network',
'ensure' => 'running', 'ensure' => 'running',
@@ -45,6 +42,9 @@ describe 'nova::network' do
)} )}
end end
describe 'when enabled is set to false' do describe 'when enabled is set to false' do
let :params do
default_params.merge(:enabled => false)
end
it { is_expected.to contain_service('nova-network').with( it { is_expected.to contain_service('nova-network').with(
'name' => 'nova-network', 'name' => 'nova-network',
'ensure' => 'stopped', 'ensure' => 'stopped',
@@ -206,9 +206,9 @@ describe 'nova::network' do
end end
it { is_expected.to contain_service('nova-network').with( it { is_expected.to contain_service('nova-network').with(
'name' => 'openstack-nova-network', 'name' => 'openstack-nova-network',
'ensure' => 'stopped', 'ensure' => 'running',
'hasstatus' => true, 'hasstatus' => true,
'enable' => false 'enable' => true
)} )}
it { is_expected.to contain_package('nova-network').with_name('openstack-nova-network') } it { is_expected.to contain_package('nova-network').with_name('openstack-nova-network') }
end end

View File

@@ -6,10 +6,6 @@ describe 'nova::scheduler' do
'include nova' 'include nova'
end end
let :params do
{ :enabled => true }
end
shared_examples 'nova-scheduler' do shared_examples 'nova-scheduler' do

View File

@@ -6,10 +6,6 @@ describe 'nova::spicehtml5proxy' do
'include nova' 'include nova'
end end
let :params do
{ :enabled => true }
end
shared_examples 'nova-spicehtml5proxy' do shared_examples 'nova-spicehtml5proxy' do
it 'configures nova.conf' do it 'configures nova.conf' do

View File

@@ -6,9 +6,7 @@ describe 'nova::vncproxy' do
'include nova' 'include nova'
end end
let :params do context 'with default parameters' do
{:enabled => true}
end
describe 'on debian platforms' do describe 'on debian platforms' do
let :facts do let :facts do
@@ -51,7 +49,7 @@ describe 'nova::vncproxy' do
'ensure' => '2012.1-2' 'ensure' => '2012.1-2'
)} )}
end end
end
end end
describe 'on debian OS' do describe 'on debian OS' do

View File

@@ -9,8 +9,7 @@ describe 'nova::generic_service' do
let :params do let :params do
{ {
:package_name => 'foo', :package_name => 'foo',
:service_name => 'food', :service_name => 'food'
:enabled => true
} }
end end

View File

@@ -16,16 +16,16 @@ shared_examples 'generic nova service' do |service|
}) })
is_expected.to contain_service(service[:name]).with({ is_expected.to contain_service(service[:name]).with({
:name => service[:service_name], :name => service[:service_name],
:ensure => 'stopped', :ensure => 'running',
:hasstatus => true, :hasstatus => true,
:enable => false :enable => true
}) })
end end
end end
context 'with overridden parameters' do context 'with overridden parameters' do
let :params do let :params do
{ :enabled => true, { :enabled => false,
:ensure_package => '2012.1-2' } :ensure_package => '2012.1-2' }
end end
@@ -37,9 +37,9 @@ shared_examples 'generic nova service' do |service|
}) })
is_expected.to contain_service(service[:name]).with({ is_expected.to contain_service(service[:name]).with({
:name => service[:service_name], :name => service[:service_name],
:ensure => 'running', :ensure => 'stopped',
:hasstatus => true, :hasstatus => true,
:enable => true :enable => false
}) })
end end
end end