puppet-wp/manifests/comment.pp
2019-09-17 19:00:27 +10:00

35 lines
739 B
Puppet

# A class for WP-CLI's commend commands.
class wp::comment (
$location,
$args,
$ensure = present,
$metacommand = false,
$user = $::wp::user,
$onlyif = "${wp::params::bin_path}/wp core is-installed",
) {
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,
}
}