init.pp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # == Class: python
  2. #
  3. # Installs and manages python, python-dev, python-virtualenv and Gunicorn.
  4. #
  5. # === Parameters
  6. #
  7. # [*version*]
  8. # Python version to install. Default: system default
  9. #
  10. # [*pip*]
  11. # Install python-pip. Default: false
  12. #
  13. # [*dev*]
  14. # Install python-dev. Default: false
  15. #
  16. # [*virtualenv*]
  17. # Install python-virtualenv. Default: false
  18. #
  19. # [*gunicorn*]
  20. # Install Gunicorn. Default: false
  21. #
  22. # === Examples
  23. #
  24. # class { 'python':
  25. # version => 'system',
  26. # pip => true,
  27. # dev => true,
  28. # virtualenv => true,
  29. # gunicorn => true,
  30. # }
  31. #
  32. # === Authors
  33. #
  34. # Sergey Stankevich
  35. #
  36. class python (
  37. $version = 'system',
  38. $pip = false,
  39. $dev = false,
  40. $virtualenv = false,
  41. $gunicorn = false
  42. ) {
  43. # Module compatibility check
  44. $compatible = [ 'Debian', 'Ubuntu', 'CentOS', 'RedHat' ]
  45. if ! ($::operatingsystem in $compatible) {
  46. fail("Module is not compatible with ${::operatingsystem}")
  47. }
  48. Class['python::install'] -> Class['python::config']
  49. include python::install
  50. include python::config
  51. }