confs
diff --git a/README.md b/README.md
index 343d17e..df0c79d 100644
--- a/README.md
+++ b/README.md
@@ -19,3 +19,4 @@
## Read more
* http://rsync.samba.org/
+* http://www.togaware.com/linux/survivor/Rsync_Server.html
\ No newline at end of file
diff --git a/conf/rsync b/conf/rsync
new file mode 100644
index 0000000..eb0e156
--- /dev/null
+++ b/conf/rsync
@@ -0,0 +1,60 @@
+{%- if grains.os_family == 'Debian' %}
+# defaults file for rsync daemon mode
+
+# start rsync in daemon mode from init.d script?
+# only allowed values are "true", "false", and "inetd"
+# Use "inetd" if you want to start the rsyncd from inetd,
+# all this does is prevent the init.d script from printing a message
+# about not starting rsyncd (you still need to modify inetd's config yourself).
+RSYNC_ENABLE=true
+
+# which file should be used as the configuration file for rsync.
+# This file is used instead of the default /etc/rsyncd.conf
+# Warning: This option has no effect if the daemon is accessed
+# using a remote shell. When using a different file for
+# rsync you might want to symlink /etc/rsyncd.conf to
+# that file.
+# RSYNC_CONFIG_FILE=
+
+# what extra options to give rsync --daemon?
+# that excludes the --daemon; that's always done in the init.d script
+# Possibilities are:
+# --address=123.45.67.89 (bind to a specific IP address)
+# --port=8730 (bind to specified port; default 873)
+RSYNC_OPTS=''
+
+# run rsyncd at a nice level?
+# the rsync daemon can impact performance due to much I/O and CPU usage,
+# so you may want to run it at a nicer priority than the default priority.
+# Allowed values are 0 - 19 inclusive; 10 is a reasonable value.
+RSYNC_NICE=''
+
+# run rsyncd with ionice?
+# "ionice" does for IO load what "nice" does for CPU load.
+# As rsync is often used for backups which aren't all that time-critical,
+# reducing the rsync IO priority will benefit the rest of the system.
+# See the manpage for ionice for allowed options.
+# -c3 is recommended, this will run rsync IO at "idle" priority. Uncomment
+# the next line to activate this.
+# RSYNC_IONICE='-c3'
+
+# Don't forget to create an appropriate config file,
+# else the daemon will not start.
+{%- endif %}
+
+{%- if grains.os_family == 'RedHat' %}
+# default: off
+# description: The rsync server is a good addition to an ftp server, as it \
+# allows crc checksumming etc.
+service rsync
+{
+ disable = no
+ flags = IPv6
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/bin/rsync
+ server_args = --daemon
+ log_on_failure += USERID
+}
+{%- endif %}
diff --git a/conf/rsyncd.conf b/conf/rsyncd.conf
index 9aec015..5274c0b 100644
--- a/conf/rsyncd.conf
+++ b/conf/rsyncd.conf
@@ -12,5 +12,4 @@
path = /srv/1/node/ {{ module.device }}
read only = {{ module.read_only }}
lock file = /var/lock/rsync_{{ module.name }}.lock
-
{%- endfor %}
diff --git a/map.jinja b/map.jinja
index f702799..5523e85 100644
--- a/map.jinja
+++ b/map.jinja
@@ -5,11 +5,16 @@
'service': 'rsyncd',
'user': 'root',
'group': 'root',
+ 'config': '/etc/default/rsync',
},
'RedHat': {
'pkgs': ['rsync', 'xinetd'],
'service': 'xinetd',
'user': 'root',
'group': 'root',
+ 'config': '/etc/xinetd.d/rsync',
},
}, merge=salt['pillar.get']('rsync:server')) %}
+
+
+
diff --git a/server.sls b/server.sls
index f73a91d..298f750 100644
--- a/server.sls
+++ b/server.sls
@@ -6,8 +6,9 @@
pkg.installed:
- names: {{ server.pkgs }}
-/etc/rsyncd.conf:
+rsync_config:
file.managed:
+ - name: /etc/rsyncd.conf
- source: salt://rsync/conf/rsyncd.conf
- template: jinja
- user: root
@@ -16,10 +17,22 @@
- require:
- pkg: rsync_packages
+rsync_startup_config:
+ file.managed:
+ - name: {{ server.config }}
+ - source: salt://rsync/conf/rsync
+ - template: jinja
+ - user: root
+ - group: root
+ - mode: 644
+ - require:
+ - pkg: rsync_packages
+
rsync_service:
service.running:
- name: {{ server.service }}
- watch:
- - file: /etc/rsyncd.conf
+ - file: rsync_config
+ - file: rsync_startup_config
{%- endif %}