X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Frsync%2Fmanifests%2Fsite.pp;h=ec4a09ecc418e6c2e10893dfbb91d05ecf516ff4;hb=ae12805e08a316f760deeca9da889b66feccf2ca;hp=8b23255af9ccd282bdbe57bb46004dff4acf56e0;hpb=447a9b57ca618b862e34289183d7771e729aea7f;p=mirror%2Fdsa-puppet.git diff --git a/modules/rsync/manifests/site.pp b/modules/rsync/manifests/site.pp index 8b23255af..ec4a09ecc 100644 --- a/modules/rsync/manifests/site.pp +++ b/modules/rsync/manifests/site.pp @@ -5,7 +5,9 @@ define rsync::site ( $content='', $fname='', $max_clients=200, - $ensure=present + $ensure=present, + $sslname='', + $sslport=1873 ){ include rsync @@ -65,5 +67,50 @@ define rsync::site ( } } + if $sslname != '' { + file { "/etc/rsyncd-${name}-stunnel.conf": + content => template('rsync/rsyncd-stunnel.conf.erb'), + require => File["/etc/ssl/debian/certs/${sslname}.crt-chained"], + } + @ferm::rule { "rsync-${name}-ssl": + domain => '(ip ip6)', + description => 'Allow rsync access', + rule => "&SERVICE(tcp, $sslport)", + } + xinetd::service { "rsync-${name}-ssl": + bind => $bind, + id => "rsync-${name}-ssl", + server => '/usr/bin/stunnel4', + server_args => "/etc/rsyncd-${name}-stunnel.conf", + service => "rsync-ssl", + type => 'UNLISTED', + port => "$sslport", + ferm => true, + instances => $max_clients, + require => File["/etc/rsyncd-${name}-stunnel.conf"], + } + if $bind6 != '' { + xinetd::service { "rsync-${name}-ssl6": + bind => $bind6, + id => "rsync-${name}-ssl6", + server => '/usr/bin/stunnel4', + server_args => "/etc/rsyncd-${name}-stunnel.conf", + service => "rsync-ssl", + type => 'UNLISTED', + port => "$sslport", + ferm => true, + instances => $max_clients, + require => File["/etc/rsyncd-${name}-stunnel.conf"], + } + } + + dnsextras::tlsa_record{ "tlsa-${sslname}-${sslport}": + zone => 'debian.org', + certfile => [ "/etc/puppet/modules/ssl/files/servicecerts/${sslname}.crt", "/etc/puppet/modules/ssl/files/from-letsencrypt/${sslname}.crt" ], + port => $sslport, + hostname => "$sslname", + } + } + Service['rsync']->Service['xinetd'] }