<<

NAME

pf::roles - OO module that performs the roles lookups for nodes

SYNOPSIS

The pf::roles OO module implements default roles lookups for nodes. All the behavior contained here can be overridden in lib/pf/roles/custom.pm.

EXPERIMENTAL

This module is considered experimental. For example not a lot of information is provided to make the role decisions. This is expected to change in the future at the cost of API changes.

You have been warned!

DEVELOPER NOTES

Singleton patterns means you should not keep state within this module.

SUBROUTINES

instance

Get the singleton instance of pf::roles. Create it if it doesn't exist.

new

Constructor. Usually you don't want to call this constructor but use the pf::roles::custom subclass instead.

METHODS

getRoleForNode

Returns the proper role for a given node.

performRoleLookup

This sub is meant to be overridden in lib/pf/roles/custom.pm if the default version doesn't do the right thing for you.

By default it will return the role according to switch configuration based on the node category. Otherwise a default global role based on the node category is returned.

In other words, node category = global role. Then per switch role will be looked up based on global role.

_assignRoleFromCategory

Return node category if defined.

AUTHOR

Inverse inc. <info@inverse.ca>

COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<