puppet-wp/manifests/command.pp
John Ericson 366718d3a7 FEAT: Ensure it now also can install wp-cli on Windows and that the wp command works to update option blogname on a WordPress installation on Windows.
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.
2021-03-17 15:27:51 +01:00

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,
}
}