---
- name: Install required packages
  package: name={{ item }} state=installed
  with_items:
    - "{{ pkg_clamd }}"
    - clamav-milter
    - "{{ pkg_dovecot }}"
    - dovecot-antispam
    - "{{ pkg_dovecot_managesieved }}"
    - "{{ pkg_dovecot_sieve }}"
    - opendkim
    - "{{ pkg_razor }}"
    - postfix
    - "{{ pkg_postfix_doc }}"
    - postfix-policyd-spf-python
    - spamassassin
    - "{{ pkg_spamass_milter }}"
  tags:
    - packages
    - mail

- import_tasks: opendkim.yml
- import_tasks: dmarc.yml
- import_tasks: spamassassin.yml
- import_tasks: clamav.yml
- import_tasks: dovecot.yml
- import_tasks: postfix.yml
- import_tasks: firewall.yml

---
- name: Install required packages
  package:
    name: "{{ item }}"
    state: present
  with_items:
    - "{{ pkg_clamd }}"
    - clamav-milter
    - "{{ pkg_dovecot }}"
    - dovecot-antispam
    - "{{ pkg_dovecot_managesieved }}"
    - "{{ pkg_dovecot_sieve }}"
    - opendkim
    - "{{ pkg_razor }}"
    - postfix
    - "{{ pkg_postfix_doc }}"
    - postfix-policyd-spf-python
    - spamassassin
    - "{{ pkg_spamass_milter }}"
  tags:
    - packages
    - mail

- import_tasks: opendkim.yml
- import_tasks: dmarc.yml
- import_tasks: spamassassin.yml
- import_tasks: clamav.yml
- import_tasks: dovecot.yml
- import_tasks: postfix.yml
- import_tasks: firewall.yml

Fix deprecated syntax for package module
Fix deprecated syntax for package module
