Initial commit
This commit is contained in:
parent
4636e6cfe0
commit
630bbcd55f
|
@ -1,28 +1,6 @@
|
|||
template formula
|
||||
rsyncd formula
|
||||
================
|
||||
|
||||
0.0.5 (2014-07-28)
|
||||
|
||||
- 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)
|
||||
0.0.1 (2015-05-01)
|
||||
|
||||
- Initial version
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -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");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
template:
|
||||
lookup:
|
||||
master: template-master
|
||||
rsyncd:
|
||||
secrets:
|
||||
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)
|
||||
|
|
|
@ -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 %}
|
|
@ -0,0 +1,3 @@
|
|||
{% for key, value in salt['pillar.get']('rsyncd:secrets').iteritems() %}
|
||||
{key}:{value}
|
||||
{% endfor%}
|
|
@ -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 %}
|
||||
|
|
|
@ -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')) %}
|
||||
|
|
Loading…
Reference in New Issue