network.pp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # === Parameters:
  2. #
  3. # [*network*]
  4. # (required) IPv4 CIDR of network to create.
  5. #
  6. # [*label*]
  7. # (optional) The label of the network.
  8. # Defaults to 'novanetwork'.
  9. #
  10. # [*num_networks*]
  11. # (optional) Number of networks to split $network into.
  12. # Defaults to 1
  13. #
  14. # [*network_size*]
  15. # (optional) Size of the network to create
  16. # Defaults to 255
  17. #
  18. # [*vlan_start*]
  19. # (optional) The vlan number to use if in vlan mode
  20. # Defaults to undef
  21. #
  22. # [*allowed_start*]
  23. # (optional) Start of allowed addresses for instances
  24. # Defaults to undef
  25. #
  26. # [*allowed_end*]
  27. # (optional) End of allowed addresses for instances
  28. # Defaults to undef
  29. #
  30. # [*project*]
  31. # (optional) Project that network should be associated with
  32. # Defaults to undef
  33. #
  34. # [*dns1*]
  35. # (optional) First DNS server
  36. # Defaults to undef
  37. #
  38. # [*dns2*]
  39. # (optional) Second DNS server
  40. # Defaults to undef
  41. #
  42. define nova::manage::network (
  43. $network,
  44. $label = 'novanetwork',
  45. $num_networks = 1,
  46. $network_size = 255,
  47. $vlan_start = undef,
  48. $project = undef,
  49. $allowed_start = undef,
  50. $allowed_end = undef,
  51. $dns1 = undef,
  52. $dns2 = undef
  53. ) {
  54. include ::nova::deps
  55. nova_network { $name:
  56. ensure => present,
  57. network => $network,
  58. label => $label,
  59. num_networks => $num_networks,
  60. network_size => $network_size,
  61. project => $project,
  62. vlan_start => $vlan_start,
  63. allowed_start => $allowed_start,
  64. allowed_end => $allowed_end,
  65. dns1 => $dns1,
  66. dns2 => $dns2,
  67. }
  68. }