Advertisement
Guest User

puppet-fun

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