--- - name: create password file(s) for rest-server copy: content: "{{ lookup('community.general.passwordstore', 'Server/{{item}}/rest-server.plain returnall=true')}}" dest: "/var/lib/restic-password-{{item}}" mode: 0700 owner: root group: root loop: - desastro - lollo - name: create password files for services copy: content: "{{ lookup('community.general.passwordstore', 'Server/{{system.hostname}}/restic/{{item}} returnall=true')}}" dest: "/var/lib/{{item}}/restic-password" owner: "{{item}}" group: "{{item}}" mode: 0700 loop: - synapse - name: create password file for postgresql copy: content: "{{ lookup('community.general.passwordstore', 'Server/{{system.hostname}}/restic/postgresql returnall=true')}}" dest: /var/lib/postgresql/restic-password owner: postgres group: postgres mode: 0700 - name: Copy backup-script to server copy: src: scripts/restic-backup/{{system.hostname}}.sh dest: /root/restic-backup.sh mode: 0755 - name: create crontab entry cron: name: "run restic-backups" special_time: daily user: root job: "/root/restic-backup.sh > /dev/null" state: present