Support cuttlefish configuration
liveforeverx opened this issue · comments
Enit should support cuttlefish configuration, the configuration should be on code, like in bashos applications, example. That means, the configuration place convention should be the same.
enit should support to generate the default configuration for release, based on configuration schemas from all applications(which have schema) in release.
enit should support to read, validate(and show, if configuration wrong, what is wrong) the cuttlefish files and apply the configuration on release. The example to show, can be the eradius configuration and simple eradius release (as it has some complex elements to configure).
The testing library cuttlefish and discussions on Skype was developed format for configuration files.
Example configuration for eradius:
# Session nodes
eradius.session.nodes = node1@host1, node2@host2
# RADIUS callback
eradius.radius_callback = tpos_pcrf_radius
# Information about servers
# <app_name>.server.<server_name>.ip.<connection name> = <ip addr>:<port>
eradius.server.root.ip.auth = 127.0.0.1:1812
eradius.server.root.ip.acc = 127.0.0.2:1813
# Information about handlers
# <app_name>.handler.<server_name>.<nas_id> = <NAS name>
eradius.handler.root.nas1 = NAS1
# Arguments for RADUIS callback
# <app_name>.handler.<server_name>.<nas_id>.args = <arg1>,<arg2>,...,<argN+1>
eradius.handler.root.nas1.args = arg1, arg2
# Sources for <server_name>.<nas_id>
# <app_name>.handler.<server_name>.<nas_id>.source.<source_name> = <ip_addr>, <secret_phrase>
eradius.handler.root.nas1.source.one = 192.168.0.3, secret1
eradius.handler.root.nas1.source.two = 192.168.0.4, secret2
eradius.handler.root.nas1.source.three = 192.168.0.5, secret3
# Options for <source_name>
# <app_name>.handler.<server_name>.source.<source_name>.<param> = <value>
eradius.handler.root.nas1.source.one.nas_id = NameA
eradius.handler.root.nas1.source.one.param2 = ValA
The result of processing the file shall be erlang term:
[{eradius,[
{reserv,[{{"NAS3",[arg1,arg2]},
[{"192.168.0.5",<<"secret3">>},
{"192.168.0.4",<<"secret2">>},
{"192.168.0.3",<<"secret1">>,[{param2,<<"ValC">>},
{nas_id,<<"NameC">>}]}]}]},
{root,[{{"NAS1",[arg1,arg2]},
[{"192.168.0.5",<<"secret3">>},
{"192.168.0.4",<<"secret2">>},
{"192.168.0.3",<<"secret1">>,[{param2,<<"ValA">>},
{nas_id,<<"NameA">>}]}]},
{{"NAS2",[arg1,arg2]},
[{"192.168.0.5",<<"secret3">>},
{"192.168.0.4",<<"secret2">>},
{"192.168.0.3",<<"secret1">>,[{param2,<<"ValB">>},
{nas_id,<<"NameB">>}]}]}]},
{radius_callback,tpos_pcrf_radius},
{servers,[{reserv,{"192.168.1.2",1813}},
{reserv,{"192.168.1.1",1812}},
{root,{"127.0.0.2",1813}},
{root,{"127.0.0.1",1812}}]},
{session_nodes,[node1@host1,node2@host2]}]
}]
Fixed schema and description.
Code preview: dyp2000/eradius@c673e3f
Added dynamic loading of configuration from cuttlefish file format
enit code preview: dyp2000@53cc88e
eradius code preview: dyp2000/eradius@f9ac20f
enit initrel <release>
still does not work
Fixed dynamic loading of configuration from cuttlefish file format
enit code preview: dyp2000@b4fdb93
eradius code preview: dyp2000/eradius@588dd6e
enit initrel <release>
still does not work
Added processing of several parameters to schema (dyp2000/eradius@6c03c2d)
Fixed applying format of cuttlefish configuration on enit startfg <release>
(dyp2000@6faa09f)
Fixed processing .schema files. Added enit initrel <release>
comand. (dyp2000@e721655)
Changed prefixes 'eradius' to 'radius', 'lager' to 'log' into eradius.conf (dyp2000/eradius@73423ce)
Added create default dirs and files for release on enit initrel
command (dyp2000@5fca350)
I have some questions about that function:
- Do I need to specify the username and group settings?
- Do I have the right to change the created directories
/etc/enit
and/etc/enit/<release_name>
?