- name: install opendkim package: name: "{{ item }}" state: present loop: - opendkim - opendkim-tools - name: main configuration files copy: src: ./files/opendkim.conf dest: /etc/opendkim.conf notify: - restart opendkim - name: dkim directory file: path: /etc/dkim state: directory - name: secondary configuration files copy: src: "./files/dkim/{{ item }}" dest: "/etc/dkim/{{ item }}" loop: - KeyTable - PeerList - SigningTable - TrustedHosts notify: - restart opendkim