[rsyncd] Do not hardcode anything in rsyncd.conf

certbot_on_virtu
_pollion 2020-08-02 00:32:30 +02:00
parent dcf6ecde48
commit 2612bfe332
1 changed files with 18 additions and 42 deletions

View File

@ -30,48 +30,24 @@ address = {{ hostvars[inventory_hostname]['ansible_' + adm_iface.stdout].ipv4.ad
# MODULE OPTIONS # MODULE OPTIONS
{# Liste des dossiers a sauvegarder par serveur, en plus de la racine. #} {# Liste des dossiers a sauvegarder par serveur, en plus de la racine. #}
[var] {% for partition in to_backup %}
path = /var
auth users = backupcrans
secrets file = /etc/rsyncd.secrets
hosts allow = zephir.adm.crans.org 10.231.136.6 {% if ansible_hostname == "sputnik" %}172.31.0.1{% endif %}
[{{ partition.name }}]
[slash] path = {{ partition.path }}
path = / {% if partition.comment is defined %}
auth users = backupcrans comment = {{ partition.comment }}
secrets file = /etc/rsyncd.secrets {% endif %}
hosts allow = zephir.adm.crans.org 10.231.136.6 {% if ansible_hostname == "sputnik" %}172.31.0.1{% endif %} {% if partition.uid is defined %}
uid = {{ partition.uid }}
{# rsync readonly pour le miroir #} gid = {{ partition.gid }}
{% if ansible_hostname == "charybde" %} {% endif %}
[ftp] {% if partition.auth_users is defined %}
path = /pubftp auth users = {{ partition.auth_users }}
comment = CRANS FTP secrets file = {{ partition.secrets_file }}
uid = nobody {% endif %}
gid = nogroup hosts allow = {{ partition.hosts_allow | join(" ") }}
hosts allow = * {% if partition.read_only is defined %}
read only = yes read only = {{ partition.read_only }}
[videolan]
path = /pubftp/videolan
comment = VideoLAN repository
uid = nobody
gid = nogroup
hosts allow = *
read only = yes
{% endif %} {% endif %}
{# on veut backuper /var/lib/mailman sur redisdead #} {% endfor %}
{% if ansible_hostname == "redisdead" %}
[mailman]
path = /var/lib/mailman
auth users = backupcrans
secrets file = /etc/rsyncd.secrets
hosts allow = zephir.adm.crans.org 10.231.136.6
{% endif %}
{# TODO: implémenter le vrai système comme dans BCFG2 #}
{# TODO: implémenter le cas particulier cpasswords-main et wiki #}