puppet-wp/manifests/comment.pp
2019-09-03 18:59:18 +10:00

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