Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enables motd to actually work

  • Loading branch information...
commit ddd3f5dcf5896e87d8d8c18129b5cd344d69938d 1 parent 32d21f1
Garrett Honeycutt authored
View
9 files/motd
@@ -0,0 +1,9 @@
+ __________________
+< I <3 Puppet Labs >
+ ------------------
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
+
View
9 manifests/server.pp
@@ -8,7 +8,8 @@
#
class rsync::server(
$use_xinetd = true,
- $address = '0.0.0.0'
+ $address = '0.0.0.0',
+ $motd_file = 'UNSET'
) inherits rsync {
$rsync_fragments = '/etc/rsync.d'
@@ -30,6 +31,12 @@
}
}
+ if $motd_file != 'UNSET' {
+ file { '/etc/rsync-motd':
+ source => 'puppet:///modules/rsync/motd',
+ }
+ }
+
file { $rsync_fragments:
ensure => directory,
}
View
8 manifests/server/module.pp
@@ -5,7 +5,6 @@
# Parameters:
# $path - path to data
# $comment - rsync comment
-# $motd - file containing motd info
# $read_only - yes||no, defaults to yes
# $write_only - yes||no, defaults to no
# $list - yes||no, defaults to yes
@@ -33,7 +32,6 @@
define rsync::server::module (
$path,
$comment = undef,
- $motd = undef,
$read_only = 'yes',
$write_only = 'no',
$list = 'yes',
@@ -44,12 +42,6 @@
$max_connections = '0',
$lock_file = '/var/run/rsyncd.lock') {
- if $motd {
- file { "/etc/rsync-motd-${name}":
- source => "puppet:///modules/rsync/motd-${motd}",
- }
- }
-
file { "${rsync::server::rsync_fragments}/frag-${name}":
content => template('rsync/module.erb'),
notify => Exec['compile fragments'],
View
1  templates/header.erb
@@ -9,3 +9,4 @@ log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
address = <%= address %>
+<% if motd_file != 'UNSET' %>motd file = <%= motd_file %><% end %>
View
1  templates/module.erb
@@ -13,6 +13,5 @@ outgoing chmod = <%= outgoing_chmod %>
max connections = <%= max_connections %>
<% if Integer(max_connections) > 0 %>lock file = <%= lock_file %><% end %>
<% if comment != :undef %>comment = <%= comment %><% end %>
-<% if motd != :undef %>motd file = /etc/rsync-motd-<%= name %><% end %>
View
1  tests/repo.pp
@@ -0,0 +1 @@
+include rsync::repo
View
3  tests/server_with_motd.pp
@@ -0,0 +1,3 @@
+class { 'rsync::server':
+ motd_file => '/etc/rsync-motd',
+}
Please sign in to comment.
Something went wrong with that request. Please try again.