Puppet Class: wp::comment

Defined in:
manifests/comment.pp

Overview

A class for WP-CLI’s commend commands.

Parameters:

  • location (Any)
  • args (Any)
  • ensure (Any) (defaults to: present)
  • metacommand (Any) (defaults to: false)
  • user (Any) (defaults to: $::wp::user)
  • onlyif (Any) (defaults to: "${wp::params::bin_path}/wp core is-installed")


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'manifests/comment.pp', line 2

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