Initial commit

This commit is contained in:
Martin Hoefling
2015-05-03 00:34:43 +02:00
parent 4636e6cfe0
commit 630bbcd55f
7 changed files with 59 additions and 37 deletions
+20
View File
@@ -0,0 +1,20 @@
{% from "rsyncd/map.jinja" import rsyncd with context %}
include:
- rsyncd
rsyncd_config_file:
file.managed:
- name: {{ rsyncd.configfile }}
- contents_pillar: rsyncd:config
- watch_in:
- service: rsync
{% if salt['pillar.get']('rsyncd:secrets') %}
rsyncd_secrets_file:
file.managed:
- name: {{ rsyncd.secretsfile }}
- watch_in:
- service: rsync
- source: salt://rsyncd/files/secrets.jinja
- template: jinja
{% endif %}
+3
View File
@@ -0,0 +1,3 @@
{% for key, value in salt['pillar.get']('rsyncd:secrets').iteritems() %}
{key}:{value}
{% endfor%}
+14 -4
View File
@@ -1,8 +1,18 @@
{% from "template/map.jinja" import template with context %}
{% from "rsyncd/map.jinja" import rsyncd with context %}
template:
rsync:
pkg.installed:
- name: {{ template.pkg }}
- name: {{ rsyncd.pkg }}
service.running:
- name: {{ template.service }}
- name: {{ rsyncd.service }}
- enable: True
{% 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 %}
+6 -5
View File
@@ -1,7 +1,8 @@
{% set rsync = salt['grains.filter_by']({
{% set rsyncd = salt['grains.filter_by']({
'Debian': {
'pkg': 'rsyncd',
'service': 'rsyncd',
'config': '/etc/rsyncd.conf',
'pkg': 'rsync',
'service': 'rsync',
'configfile': '/etc/rsyncd.conf',
'secretsfile': '/etc/rsyncd.secrets'
},
}, merge=salt['pillar.get']('rsync:lookup')) %}
}, merge=salt['pillar.get']('rsyncd:lookup')) %}