init.pp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Class: nginx
  2. #
  3. # This module manages NGINX.
  4. #
  5. # Parameters:
  6. #
  7. # There are no default parameters for this class. All module parameters are
  8. # managed via the nginx::params class
  9. #
  10. # Actions:
  11. #
  12. # Requires:
  13. # puppetlabs-stdlib - https://github.com/puppetlabs/puppetlabs-stdlib
  14. #
  15. # Packaged NGINX
  16. # - RHEL: EPEL or custom package
  17. # - Debian/Ubuntu: Default Install or custom package
  18. # - SuSE: Default Install or custom package
  19. #
  20. # stdlib
  21. # - puppetlabs-stdlib module >= 0.1.6
  22. # - plugin sync enabled to obtain the anchor type
  23. #
  24. # Sample Usage:
  25. #
  26. # The module works with sensible defaults:
  27. #
  28. # node default {
  29. # include nginx
  30. # }
  31. class nginx (
  32. $worker_processes = $nginx::params::nx_worker_processes,
  33. $worker_connections = $nginx::params::nx_worker_connections,
  34. $proxy_set_header = $nginx::params::nx_proxy_set_header,
  35. $confd_purge = $nginx::params::nx_confd_purge,
  36. $configtest_enable = $nginx::params::nx_configtest_enable,
  37. $service_restart = $nginx::params::nx_service_restart,
  38. $mail = $nginx::params::nx_mail,
  39. $server_tokens = $nginx::params::nx_server_tokens
  40. ) inherits nginx::params {
  41. include stdlib
  42. class { 'nginx::package':
  43. notify => Class['nginx::service'],
  44. }
  45. class { 'nginx::config':
  46. worker_processes => $worker_processes,
  47. worker_connections => $worker_connections,
  48. proxy_set_header => $proxy_set_header,
  49. proxy_http_version => $proxy_http_version,
  50. confd_purge => $confd_purge,
  51. server_tokens => $server_tokens,
  52. require => Class['nginx::package'],
  53. notify => Class['nginx::service'],
  54. }
  55. class { 'nginx::service':
  56. configtest_enable => $configtest_enable,
  57. service_restart => $service_restart,
  58. }
  59. # Allow the end user to establish relationships to the "main" class
  60. # and preserve the relationship to the implementation classes through
  61. # a transitive relationship to the composite class.
  62. anchor{ 'nginx::begin':
  63. before => Class['nginx::package'],
  64. notify => Class['nginx::service'],
  65. }
  66. anchor { 'nginx::end':
  67. require => Class['nginx::service'],
  68. }
  69. }