init.pp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # == Class icingaweb2
  2. #
  3. # $config_dir:: Location of the main configuration directory.
  4. # Default: operating system specific.
  5. #
  6. # $config_dir_mode:: Posix file mode for configuration directories.
  7. # Default: 0755.
  8. #
  9. # $config_dir_recurse:: Apply the same posix permissions as $config_dir to any
  10. # directory contained in $config_dir.
  11. # Default: false.
  12. #
  13. # $config_file_mode:: Posix file mode for configuration files.
  14. # Default: 0644.
  15. #
  16. # $config_group:: Posix group for configuration files.
  17. # Default: operating system specific.
  18. #
  19. # $config_user:: Posix user for configuration files.
  20. # Default: operating system specific.
  21. #
  22. # $manage_repo:: Add a custom package repository.
  23. # Default: false.
  24. #
  25. # $pkg_deps:: Any dependencies that need to be resolved before
  26. # installing the main package.
  27. # Default: operating system specific.
  28. #
  29. # $pkg_ensure:: Ensure state for packages.
  30. # Default: present.
  31. #
  32. # $pkg_list:: An array containing the main package and possibly
  33. # a number of dependencies.
  34. # Default: operating system specific.
  35. #
  36. # $web_root:: pending
  37. # Default: operating system specific.
  38. #
  39. class icingaweb2 (
  40. $config_dir = $::icingaweb2::params::config_dir,
  41. $config_dir_mode = $::icingaweb2::params::config_dir_mode,
  42. $config_dir_recurse = $::icingaweb2::params::config_dir_recurse,
  43. $config_file_mode = $::icingaweb2::params::config_file_mode,
  44. $config_group = $::icingaweb2::params::config_group,
  45. $config_user = $::icingaweb2::params::config_user,
  46. $git_repo = $::icingaweb2::params::git_repo,
  47. $git_revision = $::icingaweb2::params::git_revision,
  48. $ido_db = $::icingaweb2::params::ido_db,
  49. $ido_db_host = $::icingaweb2::params::ido_db_host,
  50. $ido_db_host = $::icingaweb2::params::ido_db_host,
  51. $ido_db_name = $::icingaweb2::params::ido_db_name,
  52. $ido_db_pass = $::icingaweb2::params::ido_db_pass,
  53. $ido_db_port = $::icingaweb2::params::ido_db_port,
  54. $ido_db_user = $::icingaweb2::params::ido_db_user,
  55. $ido_type = $::icingaweb2::params::ido_type,
  56. $install_method = $::icingaweb2::params::install_method,
  57. $manage_apache_vhost = $::icingaweb2::params::manage_apache_vhost,
  58. $manage_repo = $::icingaweb2::params::manage_repo,
  59. $pkg_deps = $::icingaweb2::params::pkg_deps,
  60. $pkg_ensure = $::icingaweb2::params::pkg_ensure,
  61. $pkg_list = $::icingaweb2::params::pkg_list,
  62. $web_db = $::icingaweb2::params::web_db,
  63. $web_db_host = $::icingaweb2::params::web_db_host,
  64. $web_db_name = $::icingaweb2::params::web_db_name,
  65. $web_db_pass = $::icingaweb2::params::web_db_pass,
  66. $web_db_port = $::icingaweb2::params::web_db_port,
  67. $web_db_prefix = $::icingaweb2::params::web_db_prefix,
  68. $web_db_user = $::icingaweb2::params::web_db_user,
  69. $web_root = $::icingaweb2::params::web_root,
  70. $web_type = $::icingaweb2::params::web_type,
  71. ) inherits icingaweb2::params {
  72. class { 'icingaweb2::preinstall': } ->
  73. class { 'icingaweb2::install': } ->
  74. class { 'icingaweb2::config': } ->
  75. Class [ 'icingaweb2' ]
  76. validate_absolute_path($config_dir)
  77. validate_absolute_path($web_root)
  78. validate_array($pkg_deps)
  79. validate_array($pkg_list)
  80. validate_bool($config_dir_recurse)
  81. validate_bool($manage_repo)
  82. validate_slength($config_dir_mode, 4)
  83. validate_slength($config_file_mode, 4)
  84. validate_string($config_dir_mode)
  85. validate_string($config_file_mode)
  86. validate_string($config_group)
  87. validate_string($config_user)
  88. validate_string($pkg_ensure)
  89. validate_re($install_method,
  90. [
  91. 'git',
  92. 'package',
  93. 'packages',
  94. ]
  95. )
  96. validate_re($pkg_ensure,
  97. [
  98. 'absent',
  99. 'latest',
  100. 'present',
  101. 'purged',
  102. ]
  103. )
  104. }