hunner/puppet-wordpress

error on installing

Opened this issue · 2 comments

I'm new to puppet and I get this error trying to install it

Notice: /Stage[main]/Wordpress::App/Concat[/var/www/wordpress/wp-config.php]/Exec[concat_/var/www/wordpress/wp-config.php]/returns: sh: 1: /var/lib/puppet/concat/bin/concatfragments.sh: Permission denied
Error: /var/lib/puppet/concat/bin/concatfragments.sh -o "/var/lib/puppet/concat/_var_www_wordpress_wp-config.php/fragments.concat.out" -d "/var/lib/puppet/concat/_var_www_wordpress_wp-config.php" returned 126 instead of one of [0]
Error: /Stage[main]/Wordpress::App/Concat[/var/www/wordpress/wp-config.php]/Exec[concat_/var/www/wordpress/wp-config.php]/returns: change from notrun to 0 failed: /var/lib/puppet/concat/bin/concatfragments.sh -o "/var/lib/puppet/concat/_var_www_wordpress_wp-config.php/fragments.concat.out" -d "/var/lib/puppet/concat/_var_www_wordpress_wp-config.php" returned 126 instead of one of [0]

here my puppet file

user { 'wordpress':
  ensure           => 'present',
  groups           => ['www-data'],
  home             => '/home/wp',

  # http://serverfault.com/questions/330069/how-to-create-an-sha-512-hashed-password-for-shadow
  password         => '$6$',
  password_max_age => '99999',
  password_min_age => '0',
  shell            => '/bin/sh',
  managehome       => true,
}

group { "wordpress":
    ensure => "present",
}

class { '::mysql::server':
  root_password    => 'xxxxx',
  override_options => { 'mysqld' => { 'max_connections' => '1024' } }
}

mysql::db { 'wordpressdb':
  user     => 'wordpress',
  password => 'xxxxxx',
  host     => 'localhost',
}

class { 'wordpress':
  wp_owner    => 'wordpress',
  wp_group    => 'www-data',
  db_user     => 'wordpress',
  db_password => xxxx',
  wp_multisite   => true,
  wp_site_domain => 'new.xxxx.net',
  wp_lang     => 'it',
  create_db      => true,
  create_db_user => false,
  db_host     => 'localhost',
  install_dir => '/var/www/wordpress',
  install_url => 'https://wordpress.org/',
}

Pleas any help would be much appreciated.

I ran into the same issue. In my case, the exec was being run as the wordpress user, which did not have permissions to /var/lib/puppet. I've found two solutions, although I suspect I'll find problems with both in the future.

The Exec block starting on line 34 of app.pp sets default behavior for exec statements. Since app.pp is calling concat, these defaults are passed along to concat, which then tries to run /var/lib/puppet/concat/bin/concatfragments.sh as the wordpress user. The default directory permissions on /var/lib/puppet prevent this from working.

  1. A quick 'chmod 755 /var/lib/puppet' gives the wordpress user execute abilities to /var/lib/puppet/concat/bin/concatfragments.sh .
  2. Comment/remove the user line (line 38) from the Exec block in app.pp.

This appears to be related to #27