- name: Install logwatch apt: name: "{{ packages }}" state: present vars: packages: - libdate-manip-perl - logwatch tags: - dependencies - name: Configure logwatch template: src=etc_logwatch_conf_logwatch.conf.j2 dest=/etc/logwatch/conf/logwatch.conf - name: Determine if rspamd is installed stat: path=/etc/rspamd register: rspamd_config_file - name: Configure rspamd to let logs through template: src=etc_rspamd_rspamd.conf.local.j2 dest=/etc/rspamd/rspamd.conf.local notify: restart rspamd when: rspamd_config_file.stat.exists == True - name: Remove logwatch's dist cronjob file: state=absent path=/etc/cron.daily/00logwatch - name: Configure weekly logwatch cronjob cron: special_time=weekly job=/usr/sbin/logwatch name=logwatch