diff --git a/manifests/init.pp b/manifests/init.pp index 9b3492b..23df204 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,6 +11,7 @@ $inotify_package = $::csync2::params::inotify_package, $csync2_exec = $::csync2::params::csync2_exec, $csync2_config = $::csync2::params::configfile, + $xinetd_group = $::csync2::params::xinetd_group, ) inherits ::csync2::params { #Validate variables @@ -29,7 +30,7 @@ xinetd::service { 'csync2': ensure => $ensure, user => 'root', - group => 'root', + group => "$xinetd_group", port => '30865', server => $csync2_exec, server_args => '-i', diff --git a/manifests/params.pp b/manifests/params.pp index 7da5e8c..6c73fdb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -17,6 +17,7 @@ $csync2_exec = '/usr/sbin/csync2' $csync2_package = 'csync2' $inotify_package = 'inotify-tools' + $xinetd_group = 'root' } 'Debian': { $configpath = '/etc' @@ -24,6 +25,15 @@ $csync2_exec = '/usr/sbin/csync2' $csync2_package = 'csync2' $inotify_package = 'inotify-tools' + $xinetd_group = 'root' + } + 'FreeBSD': { + $configpath = '/usr/local/etc' + $configfile = '/usr/local/etc/csync2.cfg' + $csync2_exec = '/usr/local/sbin/csync2' + $csync2_package = 'net/csync2' + $inotify_package = 'sysutils/inotify-tools' + $xinetd_group = 'wheel' } default: { fail("Class['csync2::params']: Unsupported OS: ${::osfamily}") diff --git a/templates/csync2_body.erb b/templates/csync2_body.erb index c8153f8..f7e8fc4 100644 --- a/templates/csync2_body.erb +++ b/templates/csync2_body.erb @@ -1,11 +1,11 @@ key <%= @configpath %>/<%= @group_key %>; - + <% Array(@includes).sort.each do |incval| -%> include <%= incval %>; <% end -%> -<% if excludes -%> +<% if @excludes -%> <% Array(@excludes).sort.each do |excval| -%> exclude <%= excval %>; <% end -%>