0
0
mirror of https://github.com/saltstack-formulas/rsyncd-formula.git synced 2024-11-27 23:07:56 +01:00
rsyncd-formula/rsyncd/init.sls
2015-05-15 23:16:45 +02:00

31 lines
746 B
Plaintext

{% 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:
file.replace:
- pattern: ^.*RSYNC_ENABLE=.*$
- repl: RSYNC_ENABLE=true
- append_if_not_found: True
- watch_in:
- service: rsync
{% endif %}