Advertisement
Guest User

eric-v4

a guest
May 9th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Puppet 1.36 KB | None | 0 0
  1. class mediawiki {
  2.  
  3.   $phpmysql = $osfamily ? {
  4.     'redhat'  => 'php-mysql',
  5.     'debian'  => 'php5-mysql',
  6.     default   => 'php-mysql',
  7.   }
  8.  
  9.   package { $phpmysql:
  10.     ensure  => 'present',
  11.   }
  12.  
  13.   if $osfamily == 'redhat' {
  14.   package { 'php-xml':
  15.     ensure => 'present',
  16.     }
  17.   }
  18.  
  19.  file  { '/var/www/html/index.html':
  20.     ensure => 'absent',
  21.  
  22.   }
  23.  
  24.  file { 'LocalSettings.php':
  25.     path    => '/var/www/html/LocalSettings.php',
  26.     ensure  => 'file',
  27.     content => template('/etc/puppetlabs/code/environments/production/modules/mediawiki/templates/LocalSettings.erb'),
  28.   }
  29.  
  30.  vcsrepo { '/var/www/html':
  31.     ensure  => 'present',
  32.     provider => 'git',
  33.     source   => "https://github.com/wikimedia/mediawiki.git",
  34.     revision  => 'REL1_23',
  35.   }
  36.  
  37.     File['/var/www/html/index.html'] -> Vcsrepo['/var/www/html']
  38.  
  39. class { '::mysql::server':
  40.  
  41.   root_password           => 'training',
  42.  
  43. }
  44. class { '::firewall':
  45.  
  46.   firewall { '000 allow http access':
  47.     port    => '80',
  48.     proto  => 'tcp',
  49.     action => 'accept'
  50.   }
  51.  
  52.   firewall { '001 allow SSH access':
  53.     port    => '22',
  54.     proto  => 'tcp',
  55.     action => 'accept'
  56.   }
  57. }
  58. class { '::apache::mod::php': }
  59.  
  60. class { '::apache':
  61.  
  62.     docroot    => '/var/www/html',
  63.     mpm_module => 'prefork',
  64.     subscribe  => Package[$phpmysql],
  65.  
  66.   }
  67.  
  68. }
  69. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement