From 8847bc72dc4e54ce056afe5738bb988804b88b36 Mon Sep 17 00:00:00 2001 From: Martin Hoefling Date: Fri, 15 May 2015 23:16:45 +0200 Subject: [PATCH] Create rsyncd.conf if not present --- rsyncd/init.sls | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rsyncd/init.sls b/rsyncd/init.sls index a57bc33..8d277c9 100644 --- a/rsyncd/init.sls +++ b/rsyncd/init.sls @@ -1,11 +1,23 @@ {% from "rsyncd/map.jinja" import rsyncd with context %} +rsyncd_conf_exists: + file.managed: + - name: {{ rsyncd.configfile }} + - contents: | + # This file is created by salt as a dummy, use the config state or override manually + pid file = /var/run/rsyncd.pid + use chroot = yes + read only = yes + - replace: false + rsync: pkg.installed: - name: {{ rsyncd.pkg }} service.running: - name: {{ rsyncd.service }} - enable: True + - require: + - file: rsyncd_conf_exists {% if grains.os_family == 'Debian' %} /etc/default/rsync: