--- - name: Create /var/log/restic/ become: true ansible.builtin.file: path: /var/log/restic state: directory recurse: true group: "{{ restic_archiver__owner }}" owner: "{{ restic_archiver__group }}" mode: 0750 - name: Install logrotate become: true ansible.builtin.package: name: logrotate state: present when: restic_archiver__logrotate | bool - name: Create logrotate config become: true ansible.builtin.copy: src: files/logrotate.conf dest: /etc/logrotate.d/restic group: "{{ restic_archiver__owner }}" owner: "{{ restic_archiver__group }}" mode: 0644 when: restic_archiver__logrotate | bool