더북(TheBook)
# /home/administrator/code/environments/production/modules/webapp/manifests/wp.pp
# 워드프레스 설치
class webapp::wp {

  $servername = "${::fqdn}" 
  $dbname = 'masterblog'

  file { '/tmp/latest.tar.gz': 
    ensure => present,
    source => 'puppet:///modules/webapp/latest.tar.gz',
  }

  exec { 'extract': 
    cwd => '/tmp',
    command => 'tar -zxvf latest.tar.gz',
    require => File['/tmp/latest.tar.gz'],
    path => ['/bin'],
  }

  file { "${dbname}": 
    ensure => directory,
    name => "/var/www/${servername}/${dbname}",
  }

  exec { 'copy': 
    command => "cp -r /tmp/wordpress/* /var/www/${servername}/${dbname}",
    require => Exec['extract'],
    path => ['/bin'],
  }

  file { "/var/www/${servername}/${dbname}/wp-config.php": 
    ensure => present,
    require => Exec['copy'],
    source => 'puppet:///modules/webapp/wp-config.php',
  }
}
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.