vlan.pp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # == Class: nova::network::vlan
  2. #
  3. # Configures nova network to use vlans
  4. #
  5. # === Parameters:
  6. #
  7. # [*fixed_range*]
  8. # (required) IPv4 CIDR of the network
  9. #
  10. # [*vlan_interface*]
  11. # (required) Physical ethernet adapter name for vlan networking
  12. #
  13. # [*public_interface*]
  14. # (optional) Interface for public traffic
  15. # Defaults to undef
  16. #
  17. # [*vlan_start*]
  18. # (optional) First vlan to use
  19. # Defaults to '300'
  20. #
  21. # [*force_dhcp_release*]
  22. # (optional) Whether to send a dhcp release on instance termination
  23. # Defaults to true
  24. #
  25. # [*dhcp_domain*]
  26. # (optional) Domain to use for building the hostnames
  27. # Defaults to 'novalocal'
  28. #
  29. # [*dhcpbridge*]
  30. # (optional) location of nova-dhcpbridge
  31. # Defaults to '/usr/bin/nova-dhcpbridge'
  32. #
  33. # [*dhcpbridge_flagfile*]
  34. # (optional) location of flagfiles for dhcpbridge
  35. # Defaults to '/etc/nova/nova.conf'
  36. #
  37. class nova::network::vlan (
  38. $fixed_range,
  39. $vlan_interface,
  40. $public_interface = undef,
  41. $vlan_start = '300',
  42. $force_dhcp_release = true,
  43. $dhcp_domain = 'novalocal',
  44. $dhcpbridge = '/usr/bin/nova-dhcpbridge',
  45. $dhcpbridge_flagfile = '/etc/nova/nova.conf'
  46. ) {
  47. include ::nova::deps
  48. if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
  49. package { 'dnsmasq-utils':
  50. ensure => present,
  51. tag => ['openstack', 'nova-support-package'],
  52. }
  53. }
  54. if $public_interface {
  55. nova_config { 'DEFAULT/public_interface': value => $public_interface }
  56. }
  57. nova_config {
  58. 'DEFAULT/network_manager': value => 'nova.network.manager.VlanManager';
  59. 'DEFAULT/fixed_range': value => $fixed_range;
  60. 'DEFAULT/vlan_interface': value => $vlan_interface;
  61. 'DEFAULT/vlan_start': value => $vlan_start;
  62. 'DEFAULT/force_dhcp_release': value => $force_dhcp_release;
  63. 'DEFAULT/dhcp_domain': value => $dhcp_domain;
  64. 'DEFAULT/dhcpbridge': value => $dhcpbridge;
  65. 'DEFAULT/dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
  66. }
  67. }