I am facing following error to copy full content of directory in multiple location.
Error: Failed to apply catalog: Parameter command failed on Exec[copy]: Command must be a String, got value of class Array at /etc/puppet/modules/wordpress/manifests/wp.pp:23
class wordpress::wp {
# Copy the Wordpress bundle to /tmp
file { '/tmp/latest.tar.gz':
ensure => present,
source => "puppet:///modules/wordpress/latest.tar.gz"
}
# Extract the Wordpress bundle
exec { 'extract':
cwd => "/tmp",
command => "tar -xvzf latest.tar.gz",
require => File['/tmp/latest.tar.gz'],
path => ['/bin'],
}
# Copy to /var/www/abc_com
exec { 'copy':
command => ["cp -r /tmp/wordpress/* /var/www/abc_com","cp -r /tmp/wordpress/* /var/www/xyz_com"],
require => Exec['extract'],
path => ['/bin'],
}
# Generate the wp-config.php file using the template for
abc.com file { '/var/www/abc_com/wp-config.php':
ensure => present,
require => Exec['copy'],
content => template("wordpress/wp-config.php.abc")
}
file { '/var/www/xyz_com/wp-config.php':
ensure => present,
require => Exec['copy'],
}
}