Added port autodiscovery for avahi services.

This commit is contained in:
Timo Mkinen 2010-01-07 14:51:31 +02:00
parent 9edbc6ae12
commit 78d29ea44f
2 changed files with 32 additions and 1 deletions

View file

@ -47,9 +47,14 @@ class avahi::daemon {
# type => "_ssh._tcp",
# }
#
define avahi::service($type, $port, $description = "%h", $ensure = "present", $txt = []) {
define avahi::service($type, $port = "AUTO", $description = "%h", $ensure = "present", $txt = []) {
$srvtype = $type
if $port == "AUTO" {
$realport = avahi_service_port($srvtype)
} else {
$realport = $port
}
file { "/etc/avahi/services/${name}.service":
ensure => $ensure,