--- - name: backup-configure | Ensure for backup user is exists user: name={{backup_user}} - name: backup-configure | Ensure for backup directories is exits file: path={{item}} state=directory owner={{backup_user}} group={{backup_group}} with_items: - "{{backup_home}}" - "{{backup_work}}" - "{{backup_logdir}}" - name: backup-configure | Install duply template: src=duply.sh.j2 dest=/usr/bin/duply owner={{backup_user}} group={{backup_group}} mode=0755 - name: backup-configure | Create profile directories file: path={{backup_home}}/{{item.name}} state=directory mode=0700 owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Configure profiles template: src=conf.j2 dest={{backup_home}}/{{item.name}}/conf owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Configure exclude lists template: src=exclude.j2 dest={{backup_home}}/{{item.name}}/exclude owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Configure pre scripts template: src=pre.j2 dest={{backup_home}}/{{item.name}}/pre owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Configure post scripts template: src=post.j2 dest={{backup_home}}/{{item.name}}/post owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Configure restore scripts template: src=restore.j2 dest={{backup_home}}/{{item.name}}/restore owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Create work directories file: state=directory path={{backup_work}}/{{item.name}} owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" - name: backup-configure | Setup cron template: src=cron.j2 dest=/etc/cron.d/backup owner=root group=root mode=0644 when: backup_cron - name: backup-configure | Create log files file: state=touch path={{backup_logdir}}/{{item.name}}.log owner={{item.user|default(backup_user)}} group={{item.group|default(backup_group)}} with_items: "{{backup_profiles}}" changed_when: False - name: backup-configure | Configure logrotate template: src=logrotate.j2 dest=/etc/logrotate.d/backup owner=root group=root mode=0644