split service and port in xinetd::service
[mirror/dsa-puppet.git] / modules / xinetd / templates / service.erb
index 33a9de7..0d89e8f 100644 (file)
@@ -1,16 +1,23 @@
-service <%= scope.lookupvar('port') %>
+service <%= scope.lookupvar('services') %>
 {
 <%- if scope.lookupvar('bind') != '' -%>
        bind            = <%= scope.lookupvar('bind') %>
 <%- end -%>
 <%- if scope.lookupvar('type') != '' -%>
        type            = <%= scope.lookupvar('type') %>
+<%- end -%>
+<%- if scope.lookupvar('port') != '' -%>
+       port            = <%= scope.lookupvar('port') %>
 <%- end -%>
        id              = <%= scope.lookupvar('id') %>
 
        socket_type     = <%= scope.lookupvar('socket_type') %>
        protocol        = <%= scope.lookupvar('protocol') %>
+<%- if scope.lookupvar('flags') != '' -%>
        flags           = <%= scope.lookupvar('flags') %>
+<%- elsif scope.lookupvar('bind') =~  /:/ or scope.lookupvar('bind') == "" -%>
+       flags           = IPv6
+<%- end -%>
        wait            = <%= scope.lookupvar('wait') %>
        user            = <%= scope.lookupvar('user') %>
 <%- if scope.lookupvar('group') != '' -%>