1 # == Class: nova::compute::neutron
3 # Manage the network driver to use for compute guests
4 # This will use virtio for VM guests and the
5 # specified driver for the VIF
9 # [*libvirt_vif_driver*]
10 # (optional) The libvirt VIF driver to configure the VIFs.
11 # Defaults to 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver'.
13 # [*force_snat_range*]
14 # (optional) Force SNAT rule to specified network for nova-network
15 # Default to 0.0.0.0/0
16 # Due to architecture constraints in nova_config, it's not possible to setup
17 # more than one SNAT rule though initial parameter is MultiStrOpt
18 class nova::compute::neutron (
19 $libvirt_vif_driver = 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver',
20 $force_snat_range = '0.0.0.0/0',
23 if $libvirt_vif_driver == 'nova.virt.libvirt.vif.LibvirtOpenVswitchDriver' {
24 fail('nova.virt.libvirt.vif.LibvirtOpenVswitchDriver as vif_driver is removed from Icehouse')
28 'libvirt/vif_driver': value => $libvirt_vif_driver;
31 if $libvirt_vif_driver == 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver' and $force_snat_range {
32 # Validate ip and mask for force_snat_range
33 $force_snat_range_array = split($force_snat_range, '/')
34 if is_ip_address($force_snat_range_array[0]) and is_integer($force_snat_range_array[1]) {
36 'DEFAULT/force_snat_range': value => $force_snat_range;
39 fail('force_snat_range should be IPv4 or IPv6 CIDR notation')
43 'DEFAULT/force_snat_range': ensure => absent;