Conditional variable references
I store some settings like the redis password, and localhost shared secrets as variables, i.e.: ldap { ... identity = ${bind_dn} ... } as I'm running a single set of configuration shared across 3 different sets of servers, with a file called 'variables' generated by puppet that contains the instance specific settings. Is there any way to have a default value for these kinds of variables so I don't have to populate unused ones with dummy values? Or to have the server ignore missing variable references? I tried instantiating the variables as empty strings, then redefining them like: # cat /etc/raddb/radius.conf ... $INCLUDE defaults $INCLUDE variables ... # cat /etc/raddb/defaults ... bind_dn = "" # cat /etc/raddb/variables ... bind_dn = "dc=jisc,dc=ac,dc=uk" Which loaded without error, but returned an empty string. Adam Bishop gpg: E75B 1F92 6407 DFDF 9F1C BF10 C993 2504 6609 D460 jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
On Jun 8, 2019, at 8:39 AM, Adam Bishop <Adam.Bishop@jisc.ac.uk> wrote:
I store some settings like the redis password, and localhost shared secrets as variables, i.e.:
ldap { ... identity = ${bind_dn} ... }
as I'm running a single set of configuration shared across 3 different sets of servers, with a file called 'variables' generated by puppet that contains the instance specific settings.
Is there any way to have a default value for these kinds of variables so I don't have to populate unused ones with dummy values? Or to have the server ignore missing variable references?
There's a "template" functionality, which is not widely used. See raddb/templates.conf You can use templates to set default values, and then over-ride them with local variables. e.g. ldap foo { # set all of the defaults $template ldap_server # over-ride it here bind_dn = "foo bar baz" }
I tried instantiating the variables as empty strings, then redefining them like:
# cat /etc/raddb/radius.conf ... $INCLUDE defaults $INCLUDE variables ...
# cat /etc/raddb/defaults ... bind_dn = ""
# cat /etc/raddb/variables ... bind_dn = "dc=jisc,dc=ac,dc=uk"
Which loaded without error, but returned an empty string.
Yes. Only the first variable is referenced. The second one is ignored. Alan DeKok.
On 9 Jun 2019, at 17:59, Alan DeKok <aland@DEPLOYINGRADIUS.COM> wrote:
There's a "template" functionality, which is not widely used. See raddb/templates.conf
You can use templates to set default values, and then over-ride them with local variables. e.g.
Perfect, I should be able to tweak things to use templates. Thanks for your help. Adam Bishop gpg: E75B 1F92 6407 DFDF 9F1C BF10 C993 2504 6609 D460 jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800. Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
participants (2)
-
Adam Bishop -
Alan DeKok