# /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', } }