modules: dhcp: Add more package versions
This commit is contained in:
@@ -32,6 +32,7 @@ import "fmt"
|
|||||||
import "golang"
|
import "golang"
|
||||||
import "local"
|
import "local"
|
||||||
import "golang/strings"
|
import "golang/strings"
|
||||||
|
import "os"
|
||||||
|
|
||||||
class server($st) {
|
class server($st) {
|
||||||
$authoritative = $st->authoritative || true
|
$authoritative = $st->authoritative || true
|
||||||
@@ -44,7 +45,14 @@ class server($st) {
|
|||||||
authoritative => $authoritative,
|
authoritative => $authoritative,
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg "dhcp-server" {
|
# TODO: add other os families and versions
|
||||||
|
$pkgs = {
|
||||||
|
"redhat" => "dhcp-server", # fedora
|
||||||
|
"debian" => "isc-dhcp-server", # debian
|
||||||
|
}
|
||||||
|
$pkg = $pkgs[os.family()] || ""
|
||||||
|
panic("${pkg}" == "") # not specified
|
||||||
|
pkg "${pkg}" {
|
||||||
state => "installed",
|
state => "installed",
|
||||||
|
|
||||||
Before => File["/etc/dhcp/"],
|
Before => File["/etc/dhcp/"],
|
||||||
|
|||||||
Reference in New Issue
Block a user