default.pp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Puppet configurations
  2. Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
  3. class base {
  4. ## Update apt-get ##
  5. exec { 'apt-get update':
  6. command => '/usr/bin/apt-get update'
  7. }
  8. }
  9. class apache
  10. {
  11. package
  12. {
  13. "apache2":
  14. ensure => present,
  15. require => Exec['apt-get update']
  16. }
  17. service
  18. {
  19. "apache2":
  20. ensure => running,
  21. enable => true,
  22. require => Package['apache2'],
  23. subscribe => [
  24. File["/etc/apache2/mods-enabled/rewrite.load"],
  25. File["/etc/apache2/sites-available/000-default.conf"]
  26. ],
  27. }
  28. file
  29. {
  30. "/etc/apache2/mods-enabled/rewrite.load":
  31. ensure => link,
  32. target => "/etc/apache2/mods-available/rewrite.load",
  33. require => Package['apache2'],
  34. }
  35. file
  36. {
  37. "/etc/apache2/sites-available/000-default.conf":
  38. ensure => present,
  39. source => "/vagrant/puppet/templates/vhost",
  40. require => Package['apache2'],
  41. }
  42. }
  43. class php{
  44. package { "php5":
  45. ensure => present,
  46. }
  47. package { "php5-cli":
  48. ensure => present,
  49. }
  50. package { "php5-xdebug":
  51. ensure => present,
  52. }-> file
  53. {
  54. "/etc/php5/mods-available/xdebug.ini":
  55. ensure => present,
  56. source => "/vagrant/puppet/templates/xdebug",
  57. require => Package['php5-xdebug'],
  58. }
  59. package { "php5-mysql":
  60. ensure => present,
  61. }
  62. package { "php5-mcrypt":
  63. ensure => present,
  64. }
  65. package { "php-pear":
  66. ensure => present,
  67. }
  68. package { "php5-dev":
  69. ensure => present,
  70. }
  71. package { "php5-curl":
  72. ensure => present,
  73. }
  74. package { "libapache2-mod-php5":
  75. ensure => present,
  76. }
  77. }
  78. class mysql{
  79. package { "mysql-server":
  80. ensure => present,
  81. }
  82. service { "mysql":
  83. ensure => running,
  84. require => Package["mysql-server"],
  85. notify => Exec["set-mysql-password"],
  86. }
  87. exec { "set-mysql-password":
  88. command => "mysqladmin -u root password root",
  89. }
  90. }
  91. include base
  92. include apache
  93. include php
  94. # We don't need mysql right now:
  95. # include mysql