[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
{# Liste des dossiers a sauvegarder par serveur, en plus de la racine. #}
[var]
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 %}
{% for partition in to_backup %}
[slash]
path = /
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 %}
{# rsync readonly pour le miroir #}
{% if ansible_hostname == "charybde" %}
[ftp]
path = /pubftp
comment = CRANS FTP
uid = nobody
gid = nogroup
hosts allow = *
read only = yes
[videolan]
path = /pubftp/videolan
comment = VideoLAN repository
uid = nobody
gid = nogroup
hosts allow = *
read only = yes
[{{ partition.name }}]
path = {{ partition.path }}
{% if partition.comment is defined %}
comment = {{ partition.comment }}
{% endif %}
{% if partition.uid is defined %}
uid = {{ partition.uid }}
gid = {{ partition.gid }}
{% endif %}
{% if partition.auth_users is defined %}
auth users = {{ partition.auth_users }}
secrets file = {{ partition.secrets_file }}
{% endif %}
hosts allow = {{ partition.hosts_allow | join(" ") }}
{% if partition.read_only is defined %}
read only = {{ partition.read_only }}
{% endif %}
{# on veut backuper /var/lib/mailman sur redisdead #}
{% 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 #}
{% endfor %}