pf::roles - OO module that performs the roles lookups for nodes
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.
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!
Singleton patterns means you should not keep state within this module.
Get the singleton instance of pf::roles. Create it if it doesn't exist.
Constructor. Usually you don't want to call this constructor but use the pf::roles::custom subclass instead.
Returns the proper role for a given node.
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.
Return node category if defined.
Inverse inc. <info@inverse.ca>
Copyright (C) 2005-2015 Inverse inc.
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.