diff --git a/conf/package_field/general_list.conf b/conf/package_field/general_list.conf new file mode 100644 index 00000000..9b37cb99 --- /dev/null +++ b/conf/package_field/general_list.conf @@ -0,0 +1,2 @@ +NAME = 'general_list' +FIELD_TYPE = list diff --git a/conf/package_metadata/openstack.conf b/conf/package_metadata/openstack.conf index 6da63d59..ed90df23 100644 --- a/conf/package_metadata/openstack.conf +++ b/conf/package_metadata/openstack.conf @@ -6,46 +6,46 @@ METADATA = { }, 'service_credentials': { '_self': { - 'required_in_whole_config': True, - 'key_extensions': { - '$service': ['image', 'compute', 'dashboard', 'identity', 'metering', 'rabbitmq', 'volume', 'mysql'] - }, + 'required_in_whole_config': True, + 'key_extensions': { + '$service': ['image', 'compute', 'dashboard', 'identity', 'metering', 'rabbitmq', 'volume', 'mysql'] + }, 'mapping_to': 'service_credentials' }, '$service': { - '_self': { - 'required_in_whole_config': True, - 'mapping_to': '$service' - }, - 'username': { - '_self': { - 'is_required': True, - 'field': 'username', - 'mapping_to': 'username' - } - }, - 'password': { - '_self': { - 'is_required': True, - 'field': 'password', - 'mapping_to': 'password' - } - } + '_self': { + 'required_in_whole_config': True, + 'mapping_to': '$service' + }, + 'username': { + '_self': { + 'is_required': True, + 'field': 'username', + 'mapping_to': 'username' + } + }, + 'password': { + '_self': { + 'is_required': True, + 'field': 'password', + 'mapping_to': 'password' + } + } } }, 'console_credentials': { - '_self': { - 'required_in_whole_config': True, - 'key_extensions': { - '$console': ['admin', 'compute', 'dashboard', 'image', 'metering', 'network', 'object-store', 'volume'] - }, - 'mapping_to': 'console_credentials' - }, - '$console': { '_self': { - 'required_in_whole_config': True, - 'mapping_to': '$console' - }, + 'required_in_whole_config': True, + 'key_extensions': { + '$console': ['admin', 'compute', 'dashboard', 'image', 'metering', 'network', 'object-store', 'volume'] + }, + 'mapping_to': 'console_credentials' + }, + '$console': { + '_self': { + 'required_in_whole_config': True, + 'mapping_to': '$console' + }, 'username': { '_self': { 'is_required': True, @@ -80,26 +80,50 @@ METADATA = { 'options': ['gre', 'vlan'], 'default_value': 'gre' } + }, + 'network_vlan_ranges': { + '_self': { + 'mapping_to': 'vlan_ranges', + 'is_required': False, + 'field': 'general_list', + 'default_value': ['physnet1:2700:2999'] + } + }, + 'bridge_mappings': { + '_self': { + 'mapping_to': 'bridge_mappings', + 'is_required': False, + 'field': 'general_list', + 'default_value': ['physnet1:br-eth1'] + } + }, + 'tunnel_id_ranges': { + '_self': { + 'mapping_to': 'tunnel_id_ranges', + 'is_required': False, + 'field': 'general_list', + 'default_value': ['1:1000'] + } } } }, 'network_mapping': { '_self': { 'required_in_whole_config': True, - 'key_extensions': { - '$interface_type': ['management', 'external', 'storage', 'tenant'] - } + 'key_extensions': { + '$interface_type': ['management', 'external', 'storage', 'tenant'] + } }, '$interface_type': { '_self': { 'required_in_whole_config': True, 'field': 'anytype', - 'autofill_callback': autofill_network_mapping, - 'mapping_to': '$interface_type' + 'autofill_callback': autofill_network_mapping, + 'mapping_to': '$interface_type' }, - 'interface': { + 'interface': { '_self': { - 'is_required': True, + 'is_required': True, 'field': 'general', } }, diff --git a/conf/templates/chef_installer/openstack_icehouse/environments/base.tmpl b/conf/templates/chef_installer/openstack_icehouse/environments/base.tmpl index 426a1a68..681b020f 100644 --- a/conf/templates/chef_installer/openstack_icehouse/environments/base.tmpl +++ b/conf/templates/chef_installer/openstack_icehouse/environments/base.tmpl @@ -58,10 +58,16 @@ ## Set Openstack neutron config #set tenant_network_type = $getDictValue('neutron_config/openvswitch/tenant_network_type', 'gre') #set enable_tunneling = True +#set tunnel_id_ranges = '' +#set vlan_ranges = '' #set bridge_mappings = '' -#if $tenant_network_type != 'gre' + +#if $tenant_network_type == 'vlan' #set enable_tunneling = False - #set bridge_mappings = 'physnet1:br-eth1' + #set bridge_mappings = ','.join($getDictValue('neutron_config/openvswitch/bridge_mappings', ['physnet1:br-eth1'])) + #set vlan_ranges = ','.join($getDictValue('neutron_config/openvswitch/vlan_ranges', ['physnet1:2700:2999'])) +#else + #set tunnel_id_ranges = ','.join($getDictValue('neutron_config/openvswitch/tunnel_id_ranges', ['1:1000'])) #end if ## Utility functions definition @@ -183,15 +189,15 @@ "ml2": { "type_drivers": "$tenant_network_type", "tenant_network_types": "$tenant_network_type", - "tunnel_id_ranges": "1:1000", - "network_vlan_ranges": "physnet1:2700:2999", + "tunnel_id_ranges": "$tunnel_id_ranges", + "network_vlan_ranges": "$vlan_ranges", "enable_security_group": "True" }, "openvswitch": { "tenant_network_type": "$tenant_network_type", "enable_tunneling": "$enable_tunneling", - "tunnel_id_ranges": "1:1000", - "network_vlan_ranges": "physnet1:2700:2999", + "tunnel_id_ranges": "$tunnel_id_ranges", + "network_vlan_ranges": "$vlan_ranges", "bridge_mappings": "$bridge_mappings", "bind_interface": "$network_worker_tenant_nic" },