StackFocus / ansible-role-postfix-dovecot

An Ansible role that automates the installation and configuration of Postfix and Dovecot with MySQL authentication
14 stars 18 forks source link

Add an example playbook in README.md #3

Open mprahl opened 7 years ago

mprahl commented 7 years ago

An example playbook should be provided in README.md to get a deployment of Dovecot and Postfix.

mem212 commented 4 years ago

Would be nice if the author adds an example

Vitexus commented 1 year ago

My Working playbook

---
- name: Setup mail
  hosts: mailserver.tld
  become: true
  vars:
    mail_domain: vitexsoftware.com
    mail_database: maildb
  roles:
    - role: geerlingguy.mysql
      mysql_databases:
        - name: '{{ mail_database }}'
          encoding: utf8mb4
          collation: utf8mb4_czech_ci
      mysql_users:
        - name: '{{ mail_database }}'
          host: "localhost"
          password: '{{ mail.db_password }}'
          priv: "{{ mail_database }}.*:ALL"      
    - role: stackfocus.postfix-dovecot
      postfix_dovecot_mysql_db_name: '{{ mail_database }}'
      postfix_dovecot_mysql_user: '{{ mail_database }}'
      postfix_dovecot_mysql_password: '{{ mail.db_password }}'
      postfix_default_domain: '{{ mail_domain }}'
      dovecot_protocols:
        - imap
        - pop3
        - lmtp
      dovecot_mail_privileged_group: vmail
      dovecot_ssl_cert: /etc/letsencrypt/live/{{ mail_domain }}/fullchain.pem
      dovecot_ssl_key: /etc/letsencrypt/live/{{ mail_domain }}/privkey.pem
      postfix_ssl_cert: /etc/letsencrypt/live/{{ mail_domain }}/fullchain.pem
      postfix_ssl_key: /etc/letsencrypt/live/{{ mail_domain }}/privkey.pem
      postfix_smtp_tls_security_level: 'dane'
      postfix_mydestination: 'vitexsoftware.com'
      postfix_myhostname: 'mail.vitexsoftware.com'
mprahl commented 1 year ago

My Working playbook

---
- name: Setup mail
  hosts: mailserver.tld
  become: true
  vars:
    mail_domain: vitexsoftware.com
    mail_database: maildb
  roles:
    - role: geerlingguy.mysql
      mysql_databases:
        - name: '{{ mail_database }}'
          encoding: utf8mb4
          collation: utf8mb4_czech_ci
      mysql_users:
        - name: '{{ mail_database }}'
          host: "localhost"
          password: '{{ mail.db_password }}'
          priv: "{{ mail_database }}.*:ALL"      
    - role: stackfocus.postfix-dovecot
      postfix_dovecot_mysql_db_name: '{{ mail_database }}'
      postfix_dovecot_mysql_user: '{{ mail_database }}'
      postfix_dovecot_mysql_password: '{{ mail.db_password }}'
      postfix_default_domain: '{{ mail_domain }}'
      dovecot_protocols:
        - imap
        - pop3
        - lmtp
      dovecot_mail_privileged_group: vmail
      dovecot_ssl_cert: /etc/letsencrypt/live/{{ mail_domain }}/fullchain.pem
      dovecot_ssl_key: /etc/letsencrypt/live/{{ mail_domain }}/privkey.pem
      postfix_ssl_cert: /etc/letsencrypt/live/{{ mail_domain }}/fullchain.pem
      postfix_ssl_key: /etc/letsencrypt/live/{{ mail_domain }}/privkey.pem
      postfix_smtp_tls_security_level: 'dane'
      postfix_mydestination: 'vitexsoftware.com'
      postfix_myhostname: 'mail.vitexsoftware.com'

Could you please file a PR to include an example such as this?