mirror of
https://gh.wpcy.net/https://github.com/Chassis/puppet-wp.git
synced 2026-05-01 14:39:23 +08:00
35 lines
724 B
Puppet
35 lines
724 B
Puppet
# A class for WP-CLI's commend commands.
|
|
class wp::comment (
|
|
$location,
|
|
$ensure = present,
|
|
$metacommand = false,
|
|
$user = $::wp::user,
|
|
$onlyif = '/usr/bin/wp core is-installed',
|
|
$args,
|
|
) {
|
|
include wp::cli
|
|
|
|
case $ensure {
|
|
present: {
|
|
$command = "create ${args}"
|
|
}
|
|
absent: {
|
|
$command = "delete ${args}"
|
|
}
|
|
generate: {
|
|
$command = "generate ${args}"
|
|
}
|
|
meta: {
|
|
$command = "${metacommand} ${args}"
|
|
}
|
|
default: {
|
|
fail( 'Invalid attribute for wp::comment' )
|
|
}
|
|
}
|
|
wp::command { "${location} comment ${command}":
|
|
location => $location,
|
|
command => "comment ${command}",
|
|
user => $user,
|
|
onlyif => $onlyif,
|
|
}
|
|
}
|