--- - name: Create directory for backups for files of {{ domain }} file: state: directory path: "{{ backups_files_directory }}/{{ domain }}" owner: root group: root mode: "u=rwx,g=rx,o=rx" - name: Install auto backup script for files of {{ domain }} template: src: "backup.sh" dest: "{{ backup_script }}" owner: root group: root mode: "u=rwx,g=rx,o=r" - name: Configure auto backup files of {{ domain }} cron: hour: 1 minute: 0 job: "{{ backup_script }}" name: "backup files of {{ domain }}" state: present