mirror of
https://github.com/saltstack-formulas/rsyncd-formula.git
synced 2026-09-19 11:24:47 +02:00
Initial commit
This commit is contained in:
@@ -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%}
|
||||
+14
-4
@@ -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
@@ -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')) %}
|
||||
|
||||
Reference in New Issue
Block a user