Instantiating modules
I am migrating and modernising a FreeRADIUS config that was written a couple of years ago, to make it more modular. I have written my own "uobsql-rnwc" module , based on the built-in "sql" module. To date, I have been loading this module in radiusd.conf, by doing: instantiate { uobsql-rnwc } This worked. As only one of my virtual servers uses this module, I want to instantiate it within the virtual server. I moved the instantiate{} block into the server{} block but this failed to load the module. It also doesn't work if I simply specify "uobsql-rnwc". In both failure modes mentioned, the syntax passes a check with radiusd -XC but prints an error when a user tries to authenticate in that virtual server: WARNING: Unknown module "uobsql-rnwc" in string expansion "%" Forgive me if I've missed something obvious. How do I load custom modules within virtual servers? Thanks, Jonathan
On Thu, Mar 14, 2013 at 02:14:57PM +0000, Jonathan Gazeley wrote:
instantiate { uobsql-rnwc }
This worked.
OK.
Forgive me if I've missed something obvious. How do I load custom modules within virtual servers?
Just put it in the global instantiate section, as above, then use it in the virtual server. Matthew -- Matthew Newton, Ph.D. <mcn4@le.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom For IT help contact helpdesk extn. 2253, <ithelp@le.ac.uk>
On 14/03/13 14:26, Matthew Newton wrote:
Just put it in the global instantiate section, as above, then use it in the virtual server.
The point of my exercise is to make my FreeRADIUS config fully modular in preparation for my suite of RADIUS servers being managed by a config management tool, and therefore edits to a global file are not helpful. I suppose I could set up an includes.d/ arrangement so snippets of file can be dropped into place in the global config, but really I would rather solve the problem "properly" by loading only the needed modules in virtual servers. Any suggestions? Thanks, Jonathan
On Thu, Mar 14, 2013 at 03:04:08PM +0000, Jonathan Gazeley wrote:
On 14/03/13 14:26, Matthew Newton wrote:
Just put it in the global instantiate section, as above, then use it in the virtual server.
The point of my exercise is to make my FreeRADIUS config fully modular in preparation for my suite of RADIUS servers being managed by a config management tool, and therefore edits to a global file are not helpful.
I suppose I could set up an includes.d/ arrangement so snippets of file can be dropped into place in the global config, but really I would rather solve the problem "properly" by loading only the needed modules in virtual servers.
Any suggestions?
A "virtual server" is essentially a collection of config blocks for authorize/authenticate/accounting, etc, that call modules in the main server. You can configure the server to send particular packets (using listen statements, or options in clients.conf, or, e.g. EAP virtual server settings) through a particular "virtual server" - i.e. a particular config. That's it - it's a configuration. The modules are global to the server, so what you did first was right. For config management, if you really don't want it instantiated on some servers, I guess you could $INCLUDE a file instead of the instantiate{} block, and move this to a separate file dependent on the server. We do this sort of thing with cfengine, often using a symlink with the hostname in it, and the $INCLUDE is to the symlink. Then have one file per server with the required config. Cheers, Matthew -- Matthew Newton, Ph.D. <mcn4@le.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom For IT help contact helpdesk extn. 2253, <ithelp@le.ac.uk>
participants (2)
-
Jonathan Gazeley -
Matthew Newton