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

86 lines
1.8 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.

# Option
* [Description](/classes/option.html#description)
* [Attributes](/classes/option.html#attributes)
## Description
Retrieves and sets site options, including plugin and WordPress settings.
## Attributes
``` puppet
wp::option { 'resource title':
location => # The location to run the command.
key => # The name of the option to add.
value => # The value of the option to add.
ensure => # What state the option should be in.
format => # The serialization format for the value.
autoload => # Should this option be automatically loaded.
user => # The user to run the command as.
}
```
### location
The directory from which to run the command. If this directory does not exist, the command will fail.
### key
(*If omitted, this attributes value defaults to the resources title.*)
The name of the option to add.
### value
(*If omitted, this attributes value defaults `undef`.*)
The value of the option to add.
### ensure
(*If omitted, this attributes value defaults to `present`*)
Values: `present`, `equal`, `absent`.
### format
(*If omitted, this attributes value defaults to `plaintext`*)
Values: `plaintext` or `json`.
### autoload
(*If omitted, this attributes value defaults to `true`*).
Values: `true` or `false`.
### user
(*If omitted, this attributes value defaults to `www-data`.*)
#### Examples
``` puppet
wp::option 'Add and set Foo to Bar' {
location => '/vagrant',
key => 'Foo',
value => 'Bar' ,
}
```
``` puppet
wp::option 'Update Foo to Fighters' {
location => '/vagrant',
key => 'Foo',
value => 'Fighters',
ensure => equal
}
```
``` puppet
wp::option 'Delete Foo' {
location => '/vagrant',
key => 'Foo',
ensure => abest
}
```