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

1.8 KiB
Raw Permalink Blame History

Option

Description

Retrieves and sets site options, including plugin and WordPress settings.

Attributes

	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

    wp::option 'Add and set Foo to Bar' {
        location => '/vagrant',
        key      => 'Foo',
        value    => 'Bar' ,
    }
    wp::option 'Update Foo to Fighters' {
        location => '/vagrant',
        key      => 'Foo',
        value    => 'Fighters',
        ensure   => equal
    }
    wp::option 'Delete Foo' {
        location => '/vagrant',
        key      => 'Foo',
        ensure   => abest
    }