Initial commit

This commit is contained in:
Martin Hoefling 2015-05-02 00:06:42 +02:00
parent 4636e6cfe0
commit 630bbcd55f
7 changed files with 59 additions and 37 deletions

View File

@ -1,28 +1,6 @@
template formula rsyncd formula
================ ================
0.0.5 (2014-07-28) 0.0.1 (2015-05-01)
- Fixed broken link to Salt Formula documentation
0.0.4 (2014-02-26)
- Add CHANGELOG.rst
0.0.3 (2014-02-17)
- Add map.jinja
- Use map.jinja content in init.sls
0.0.2 (2014-02-16)
- Better README extension changed from .md to .rst
- Add link to Salt Formula documentation
0.0.1 (2013-11-03)
- Initial version - Initial version

View File

@ -1,4 +1,4 @@
Copyright (c) 2014 Salt Stack Formulas Copyright (c) 2015 Salt Stack Formulas
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,3 +1,13 @@
template: rsyncd:
lookup: secrets:
master: template-master user: mypassword
config: |
uid = nobody
gid = nobody
use chroot = yes
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid
[ftp]
path = /var/ftp/./pub
comment = whole ftp area (approx 6.1 GB)

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 %}

View File

@ -0,0 +1,3 @@
{% for key, value in salt['pillar.get']('rsyncd:secrets').iteritems() %}
{key}:{value}
{% endfor%}

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: pkg.installed:
- name: {{ template.pkg }} - name: {{ rsyncd.pkg }}
service.running: service.running:
- name: {{ template.service }} - name: {{ rsyncd.service }}
- enable: True - 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 %}

View File

@ -1,7 +1,8 @@
{% set rsync = salt['grains.filter_by']({ {% set rsyncd = salt['grains.filter_by']({
'Debian': { 'Debian': {
'pkg': 'rsyncd', 'pkg': 'rsync',
'service': 'rsyncd', 'service': 'rsync',
'config': '/etc/rsyncd.conf', 'configfile': '/etc/rsyncd.conf',
'secretsfile': '/etc/rsyncd.secrets'
}, },
}, merge=salt['pillar.get']('rsync:lookup')) %} }, merge=salt['pillar.get']('rsyncd:lookup')) %}