Chassis / puppet-wp

This module enables the easy use of WP CLI to control your WordPress site through Puppet manifests
https://chassis.github.io/puppet-wp/
GNU Lesser General Public License v3.0
44 stars 39 forks source link

wrong user in wp::plugin #26

Closed atao60 closed 5 years ago

atao60 commented 10 years ago

ubuntu : 14.04 puppet : 3.4.3 vagrant (on the host) : 1.5.4

I'm using puppet-wp inside a Vagrant provisioner. I downloaded it from the git repository.

Main issue: wp::plugin is unable to install any plugin. The exec "wp install plugin $title" inside the "ensure" case runs with 'root' as user: "wp plugin install" doesn't like it and does nothing, without throwing any error. Then the final "wp plugin activate" does throw an error as it can't find the plugin. Adding a "user => $::wp::user," with the exec "wp install plugin $title" makes everybody (almost) happy...

Secondary issue: With the above change, when the user is not the default one (i.e. www-data), the plugin is not installed. But then there is no error at all. The configuration is achieved with success. Even with the puppet debug option, there is no good clue. Not even the "Warning: Could not create directory." usually thrown by the command "wp plugin install".

joshbetz commented 10 years ago

I have the same issue. I need to be able to set the user, but I think it's hard-coded to 'www-data'.

technicalpickles commented 10 years ago

With the above change, when the user is not the default one (i.e. www-data), the plugin is not installed.

How are you setting the user? I don't see an obvious way to set it.

I agree that user => $::wp::user does need to be used for all Execs though.