From b15fecdc380b96dceda25b9a144b8bd6d0b99c24 Mon Sep 17 00:00:00 2001 From: "Mark T. Voelker" Date: Mon, 23 Sep 2013 14:58:16 -0400 Subject: [PATCH] Add force_config_drive to openstack::all Currently the openstack::all class doesn't expose a parameter for the force_config_drive option in nova.conf. The underlying ::nova::compute class does have such a parameter. This commit exposes force_config_drive as a parameter to the openstack::all class and passes it down to the ::nova::compute class appropriately. By default it is set to false to preserve backward compatibility. Change-Id: Iab0f0b1f358e22bfe2e79cf9c9adbd83f77eef7a Implements: blueprint force-config-drive-for-all-class --- manifests/all.pp | 2 ++ spec/classes/openstack_all_spec.rb | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/manifests/all.pp b/manifests/all.pp index 2121e6f..8b905ea 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -158,6 +158,7 @@ class openstack::all ( $purge_nova_config = false, $libvirt_vif_driver = 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver', $enabled_apis = 'ec2,osapi_compute,metadata', + $force_config_drive = false, # Virtualization $libvirt_type = 'kvm', $migration_support = false, @@ -358,6 +359,7 @@ class openstack::all ( vnc_enabled => $vnc_enabled, vncserver_proxyclient_address => $internal_address_real, vncproxy_host => $vncproxy_host, + force_config_drive => $force_config_drive } # Configure libvirt for nova-compute diff --git a/spec/classes/openstack_all_spec.rb b/spec/classes/openstack_all_spec.rb index 98d556e..1ba852d 100644 --- a/spec/classes/openstack_all_spec.rb +++ b/spec/classes/openstack_all_spec.rb @@ -126,6 +126,25 @@ describe 'openstack::all' do end end + context 'with neutron_user_password, neutron_db_password, bridge_interface, ovs_local_ip, metadata_shared_secret, and force_config_drive set' do + before do + params.merge!( + :neutron_user_password => 'neutron_user_password', + :neutron_db_password => 'neutron_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :metadata_shared_secret => 'shared_md_secret', + :force_config_drive => true + ) + end + it 'contains a nova::compute class with force_config_drive set' do + should contain_class('nova::compute').with( + :enabled => true, + :force_config_drive => true + ) + end + end + context 'with neutron_user_password, neutron_db_password, bridge_interface, ovs_local_ip, bridge_mappings, bridge_uplinks, and shared_secret set' do before do params.merge!(