mirror of
https://gh.wpcy.net/https://github.com/Chassis/puppet-wp.git
synced 2026-05-10 05:15:19 +08:00
FEAT: Added new parameters php_executable_path, bin_path, executable_filename to the wp class. These now have default values both for Linux and Windows. BUG: On Windows I set the exec user that is used to run the wp-cli command to undef so prevent this bug from happening https://tickets.puppetlabs.com/browse/ENTERPRISE-13. On Windows you can't run an exec as another user. The wp-cli client doesn't complain about this when I tested to run it as the SYSTEM user in Windows, which is the Puppet default. MISC: Respected tab indenting in cli.pp, command.pp, init.pp, params.pp.
19 lines
446 B
Puppet
Executable file
19 lines
446 B
Puppet
Executable file
# A class for WP-CLI commands.
|
|
define wp::command (
|
|
$location,
|
|
$command,
|
|
$user = $::wp::user,
|
|
$unless = undef,
|
|
$onlyif = "${wp::bin_path}/${wp::executable_filename} core is-installed",
|
|
) {
|
|
include wp::cli
|
|
|
|
exec {"${location} wp ${command}":
|
|
command => "${wp::bin_path}/${wp::executable_filename} ${command}",
|
|
cwd => $location,
|
|
user => $user,
|
|
require => [ Class['wp::cli'] ],
|
|
unless => $unless,
|
|
onlyif => $onlyif,
|
|
}
|
|
}
|