NAME

Pantry::Model::Role - Pantry data model for Chef roles

VERSION

version 0.012

DESCRIPTION

Under development.

ATTRIBUTES

default_attributes

This attribute holds role default attribute data as key-value pairs. Keys may be separated by a period to indicate nesting (literal periods must be escaped by a backslash). Values should be scalars or array references.

override_attributes

This attribute holds role override attribute data as key-value pairs. Keys may be separated by a period to indicate nesting (literal periods must be escaped by a backslash). Values should be scalars or array references.

METHODS

set_default_attribute

$role->set_default_attribute("nginx.port", 80);

Sets the role default attribute for the given key to the given value.

get_default_attribute

my $port = $role->get_default_attribute("nginx.port");

Returns the role default attribute for the given key.

delete_default_attribute

$role->delete_default_attribute("nginx.port");

Deletes the role default attribute for the given key.

set_override_attribute

$role->set_override_attribute("nginx.port", 80);

Sets the role override attribute for the given key to the given value.

get_override_attribute

my $port = $role->get_override_attribute("nginx.port");

Returns the role override attribute for the given key.

delete_override_attribute

$role->delete_override_attribute("nginx.port");

Deletes the role override attribute for the given key.

append_to_env_run_list

$role->append_to_env_run_list( $env, \@items );

Appends items to an environment-specific runlist.

remove_from_env_run_list

$role->remove_from_env_run_list( $env, \@items );

Removes items from an environment-specific runlist.

save

Saves the node to a file in the pantry. If the private _path attribute has not been set, an exception is thrown.

AUTHOR

David Golden <dagolden@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2011 by David Golden.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004