default.pp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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-imagick":
  63. ensure => present,
  64. }
  65. package { "php5-mcrypt":
  66. ensure => present,
  67. }
  68. package { "php-pear":
  69. ensure => present,
  70. }
  71. package { "php5-dev":
  72. ensure => present,
  73. }
  74. package { "php5-curl":
  75. ensure => present,
  76. }
  77. package { "php5-sqlite":
  78. ensure => present,
  79. }
  80. package { "libapache2-mod-php5":
  81. ensure => present,
  82. }
  83. exec { "reload_apache":
  84. command => "/etc/init.d/apache2 reload",
  85. }
  86. }
  87. class mysql{
  88. package { "mysql-server":
  89. ensure => present,
  90. }
  91. service { "mysql":
  92. ensure => running,
  93. require => Package["mysql-server"],
  94. notify => Exec["set-mysql-password"],
  95. }
  96. exec { "set-mysql-password":
  97. command => "mysqladmin -u root password root",
  98. }
  99. }
  100. include base
  101. include apache
  102. include php
  103. include mysql