cells.pp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
  3. #
  4. # Author: Emilien Macchi <emilien.macchi@enovance.com>
  5. # Francois Charlier <francois.charlier@enovance.com>
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  8. # not use this file except in compliance with the License. You may obtain
  9. # a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. # License for the specific language governing permissions and limitations
  17. # under the License.
  18. #
  19. #
  20. # Configuring the database in each cell
  21. # == Namevar
  22. # The namevar will be the name of the cell
  23. #
  24. # == Parameters
  25. # [*cell_type*]
  26. # (optional) Whether the cell is a 'parent' or 'child'
  27. # Defaults to 'parent'
  28. #
  29. # [*cell_parent_name*]
  30. # (optional) If a child cell, this is the name of the 'parent' cell.
  31. # If a parent cell, should be left to undef.
  32. # Defaults to undef
  33. #
  34. # [*rabbit_username*]
  35. # (optional) Username for the message broker in this cell
  36. # Defaults to 'guest'
  37. #
  38. # [*rabbit_password*]
  39. # (optional) Password for the message broker in this cell
  40. # Defaults to 'guest'
  41. #
  42. # [*rabbit_hosts*]
  43. # (optional) Address of the message broker in this cell
  44. # Defaults to ['localhost']
  45. #
  46. # [*rabbit_port*]
  47. # (optional) Port number of the message broker in this cell
  48. # Defaults to '5672'
  49. #
  50. # [*rabbit_virtual_host*]
  51. # (optional) The virtual host of the message broker in this cell
  52. # Defaults to '/'
  53. #
  54. # [*weight_offset*]
  55. # (optional) It might be used by some cell scheduling code in the future
  56. # Defaults to '1.0'
  57. #
  58. # [*weight_scale*]
  59. # (optional) It might be used by some cell scheduling code in the future
  60. # Defaults to '1.0'
  61. #
  62. define nova::manage::cells (
  63. $cell_type = 'parent',
  64. $cell_parent_name = undef,
  65. $rabbit_username = 'guest',
  66. $rabbit_password = 'guest',
  67. $rabbit_hosts = ['localhost'],
  68. $rabbit_port = '5672',
  69. $rabbit_virtual_host = '/',
  70. $weight_offset = '1.0',
  71. $weight_scale = '1.0'
  72. ) {
  73. include ::nova::deps
  74. nova_cells { $name:
  75. ensure => present,
  76. cell_type => $cell_type,
  77. cell_parent_name => $cell_parent_name,
  78. rabbit_username => $rabbit_username,
  79. rabbit_password => $rabbit_password,
  80. rabbit_hosts => $rabbit_hosts,
  81. rabbit_port => $rabbit_port,
  82. rabbit_virtual_host => $rabbit_virtual_host,
  83. weight_offset => $weight_offset,
  84. weight_scale => $weight_scale
  85. }
  86. }