flatdhcp.pp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # == Class: nova::network::flatdhcp
  2. #
  3. # Configures nova-network with flat dhcp option
  4. #
  5. # === Parameters:
  6. #
  7. # [*fixed_range*]
  8. # (required) The IPv4 CIDR for the flat network
  9. #
  10. # [*flat_interface*]
  11. # (optional) FlatDHCP will bridge into this interface
  12. # Defaults to undef
  13. #
  14. # [*public_interface*]
  15. # (optional)
  16. # Defaults to undef
  17. #
  18. # [*flat_network_bridge*]
  19. # (optional) Bridge for simple network instances (
  20. # Defaults to 'br100'
  21. #
  22. # [*force_dhcp_release*]
  23. # (optional) Send a dhcp release on instance termination
  24. # Defaults to true
  25. #
  26. # [*flat_injected*]
  27. # (optional) Whether to attempt to inject network setup into guest
  28. # Defaults to false
  29. #
  30. # [*dhcp_domain*]
  31. # (optional) domain to use for building the hostnames
  32. # Defaults to 'novalocal'
  33. #
  34. # [*dhcpbridge*]
  35. # (optional) 'location of nova-dhcpbridge'
  36. # Defaults to '/usr/bin/nova-dhcpbridge'
  37. #
  38. # [*dhcpbridge_flagfile*]
  39. # (optional) location of flagfiles for dhcpbridge
  40. # Defaults to '/etc/nova/nova.conf
  41. #
  42. class nova::network::flatdhcp (
  43. $fixed_range,
  44. $flat_interface = undef,
  45. $public_interface = undef,
  46. $flat_network_bridge = 'br100',
  47. $force_dhcp_release = true,
  48. $flat_injected = false,
  49. $dhcp_domain = 'novalocal',
  50. $dhcpbridge = '/usr/bin/nova-dhcpbridge',
  51. $dhcpbridge_flagfile = '/etc/nova/nova.conf'
  52. ) {
  53. include ::nova::deps
  54. if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
  55. package { 'dnsmasq-utils':
  56. ensure => present,
  57. tag => ['openstack', 'nova-support-package'],
  58. }
  59. }
  60. if $public_interface {
  61. nova_config { 'DEFAULT/public_interface': value => $public_interface }
  62. }
  63. nova_config {
  64. 'DEFAULT/network_manager': value => 'nova.network.manager.FlatDHCPManager';
  65. 'DEFAULT/fixed_range': value => $fixed_range;
  66. 'DEFAULT/flat_interface': value => $flat_interface;
  67. 'DEFAULT/flat_network_bridge': value => $flat_network_bridge;
  68. 'DEFAULT/force_dhcp_release': value => $force_dhcp_release;
  69. 'DEFAULT/flat_injected': value => $flat_injected;
  70. 'DEFAULT/dhcp_domain': value => $dhcp_domain;
  71. 'DEFAULT/dhcpbridge': value => $dhcpbridge;
  72. 'DEFAULT/dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
  73. }
  74. }