diff --git a/manifests/compute.pp b/manifests/compute.pp index 2aee5bd28..975fefc50 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -69,6 +69,10 @@ # Time period must be hour, day, month or year # Defaults to 'month' # +# [*force_raw_images*] +# (optional) Force backing images to raw format. +# Defaults to true +# class nova::compute ( $enabled = false, $manage_service = true, @@ -85,7 +89,8 @@ class nova::compute ( $neutron_enabled = true, $network_device_mtu = undef, $instance_usage_audit = false, - $instance_usage_audit_period = 'month' + $instance_usage_audit_period = 'month', + $force_raw_images = true, ) { include nova::params @@ -159,4 +164,8 @@ class nova::compute ( package { 'pm-utils': ensure => present, } + + nova_config { + 'DEFAULT/force_raw_images': value => $force_raw_images; + } } diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index c70202724..c1fc79d57 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -33,6 +33,8 @@ describe 'nova::compute' do it { should contain_package('pm-utils').with( :ensure => 'present' ) } + + it { should contain_nova_config('DEFAULT/force_raw_images').with(:value => true) } end context 'with overridden parameters' do @@ -40,7 +42,8 @@ describe 'nova::compute' do { :enabled => true, :ensure_package => '2012.1-2', :vncproxy_host => '127.0.0.1', - :network_device_mtu => 9999 } + :network_device_mtu => 9999, + :force_raw_images => false } end it 'installs nova-compute package and service' do @@ -67,6 +70,8 @@ describe 'nova::compute' do 'http://127.0.0.1:6080/vnc_auto.html' ) end + + it { should contain_nova_config('DEFAULT/force_raw_images').with(:value => false) } end context 'with neutron_enabled set to false' do