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 attribute’s value defaults to the resource’s title.)

The name of the option to add.

value

(If omitted, this attribute’s value defaults undef.)

The value of the option to add.

ensure

(If omitted, this attribute’s value defaults to present)

Values: present, equal, absent.

format

(If omitted, this attribute’s value defaults to plaintext)

Values: plaintext or json.

autoload

(If omitted, this attribute’s value defaults to true).

Values: true or false.

user

(If omitted, this attribute’s 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
    }