modules: misc: Use a template for network

Just a bug, now fixed.
This commit is contained in:
James Shubin
2025-06-08 04:21:27 -04:00
parent 1ef7c370e7
commit cfcb35456f

View File

@@ -127,9 +127,8 @@ Name=${dev}
class networkd_dhcp($dev, $st) { class networkd_dhcp($dev, $st) {
$dns = $st->dns || ["8.8.8.8",] $dns = $st->dns || ["8.8.8.8",]
file "/etc/systemd/network/${dev}-dhcp.network" { $tmpl =
state => "exists", "
content => "
[Match] [Match]
Name=${dev} Name=${dev}
@@ -143,7 +142,16 @@ DNS={{ . }}
[DHCP] [DHCP]
UseDNS=false UseDNS=false
RouteMetric=100 RouteMetric=100
", "
$args = struct{
#dev => $dev,
dns => $dns,
}
file "/etc/systemd/network/${dev}-dhcp.network" {
state => "exists",
content => golang.template($tmpl, $args),
mode => "u=rw,go=r", mode => "u=rw,go=r",
owner => "root", owner => "root",
group => "root", group => "root",