Advertisement
ed209

Puppet Manifest

Jul 13th, 2012
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.21 KB | None | 0 0
  1. # related to question http://stackoverflow.com/posts/11411778
  2.  
  3. Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
  4.  
  5. class system-update{
  6.  
  7.   exec { 'apt-get update':
  8.     command => 'apt-get update',
  9.   }
  10.  
  11. }
  12.  
  13. class php5{
  14.     package { "php5":
  15.         ensure => present,
  16.         require => Exec['apt-get update'],
  17.     }
  18. }
  19.  
  20. class mysql {
  21.   package {
  22.     ['mysql-common', 'mysql-client', 'mysql-server']:
  23.       ensure => present
  24.   }
  25.  
  26.   package { "php5-mysql" :
  27.     ensure => installed,
  28.     require => Package['php5'],
  29.   }
  30.  
  31.   service {
  32.     'mysql':
  33.       enable => true,
  34.       ensure => running,
  35.       require => Package['mysql-server']
  36.   }
  37.  
  38.   exec {
  39.     'set-root-password':
  40.       subscribe => [Package['mysql-common'], Package['mysql-client'], Package['mysql-server']],
  41.       refreshonly => true,
  42.       unless => "mysqladmin -uroot -proot",
  43.       command => "mysqladmin -uroot password root",
  44.       #require => Package['mtop'] # mtop needs an empty root password
  45.   }
  46. }
  47.  
  48. class extras{
  49.     package { "openjdk-6-jre":
  50.         ensure => installed,
  51.         require => Exec['apt-get update'],
  52.     }
  53. }
  54.    
  55.  
  56. include system-update
  57. include php5
  58. include mysql
  59. include extras
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement