Unfortunately, no dice–I get the same result with that.
I think it’s a little premature to put anything up there at this point, but here’s the fragment I’m working with:
{
use esmith::NetworksDB;
use strict;
my $ndb = esmith::NetworksDB->open_ro() || die "Can't open networks database: $!\n";
foreach ($ndb->red()) {
my $ip = $_>prop('ipaddr') || next;
}
my $domain = "acme.".${DomainName};
my $nsname = "ns1.acme.".${DomainName};
my $nsadmin = "admin.".${DomainName};
my $domaindot = "acme.".${DomainName}.".";
my $nsnamedot = "ns1.acme.".${DomainName}.".";
my $ns2namedot = "ns2.acme.".${DomainName}.".";
$OUT .= <<EOF
[general]
# dns interface
listen = "$ip:1053"
# protocol, "udp", "udp4", "udp6" or "tcp", "tcp4", "tcp6"
protocol = "udp"
# domain name to serve the requests off of
domain = "$domain"
# zone name server
nsname = "$nsname"
# admin email address, where @ is substituted with .
nsadmin = "$nsadmin"
# predefined records served in addition to the TXT
records = [
# default A
"$domaindot A $ip",
# A
"$nsnamedot A $ip",
"$ns2namedot A $ip",
# NS
"$domaindot NS $nsnamedot",
"$domaindot NS $ns2namedot",
]
# debug messages from CORS etc
debug = false
EOF
}
What I’ve been doing to test it, since I need a machine with a red interface, is put this fragment on my production box at /etc/e-smith/templates-custom/etc/test/10global
, and then run expand-template /etc/test
. When I do, I get this:
[root@neth test]# expand-template /etc/test
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 10.
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 11.
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 12.
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 13.
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 14.
WARNING in /etc/e-smith/templates//etc/test/10global: Variable "$DomainName" is not imported at /etc/e-smith/templates//etc/test/10global line 15.
ERROR in /etc/e-smith/templates//etc/test/10global: Program fragment delivered error <<Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 10.
Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 11.
Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 12.
Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 13.
Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 14.
Global symbol "$DomainName" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 15.
Global symbol "$ip" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 17.
Global symbol "$ip" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 17.
Global symbol "$ip" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 17.
Global symbol "$ip" requires explicit package name at /etc/e-smith/templates//etc/test/10global line 17.>> at template line 1
ERROR: Template processing failed for //etc/test: 6 fragments generated warnings, 1 fragment generated errors
at /sbin/e-smith/expand-template line 45.