puppet-wp/docs/classes/comment.md
2019-09-03 18:13:20 +10:00

57 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Comment
* [Description](/classes/comment.html#description)
* [Attributes](/classes/comment.html#attributes)
## Description
Creates, updates and deletes comments.
## Attributes
```puppet
wp::comment { 'resource title':
location => # The location to run the command.
ensure => # What state the cap should be in.
metacommand => # Is the comment's meta being altered.
user => # The user to run the command as.
args => # The string of arguments to pass to the comment command.
onlyif => # A test command that checks the state of the target system and restricts when the exec can run.
}
```
### location
The directory from which to run the command. If this directory does not exist, the command will fail.
### ensure
(*If omitted, this attributes value defaults to `present`.*)
The state the comment should be in.
Values: `present`, `absent`, `generate` or `meta`.
### metacommand
(*If omitted, this attributes value defaults to `false`.*)
The type of meta command to run.
Values: `add`, `delete`, `patch` or `update`.
### user
(*If omitted, this attributes value defaults to `www-data`.*)
### args
A string of arguments to pass to the command. e.g.
* If `ensure => generate` then `args => '--count=100'` would generate 100 comments.
* If `ensure => present` then `args => '--comment_post_ID=15 --comment_content="hello blog" --comment_author="wp-cli"'` would add one comment.
* IF `ensure => absent` then `args => '1337 2341 --force'` would delete two comments and not trash them.
### onlyif
(*If omitted, this attributes value defaults to `/usr/bin/wp core is-installed`.*)
You can pass one or more checks into Puppet for this.