--- - name: postfix sql map directory file: path: /etc/postfix/sql/ state: directory mode: u=rwx,g=rx,o= group: postfix - name: postfixadmin sql map configuration template: src: sql/{{item}}.j2 dest: /etc/postfix/sql/{{item}} mode: u=rwx,g=rx,o= group: postfix with_items: - mysql_virtual_alias_domain_catchall_maps.cf - mysql_virtual_alias_domain_maps.cf - mysql_virtual_domains_maps.cf - mysql_virtual_mailbox_maps.cf - mysql_virtual_alias_domain_mailbox_maps.cf - mysql_virtual_alias_maps.cf - mysql_virtual_mailbox_limit_maps.cf - name: postfixadmin mysql user mysql_user: name: "{{postfix_postfixadmin_mysql_username}}" password: "{{postfix_postfixadmin_mysql_password}}" priv: "{{postfix_postfixadmin_mysql_database}}.*:SELECT" state: present