Files @ 92011aae7258
Branch filter:

Location: majic-ansible-roles/roles/mail_server/molecule/default/playbook.yml

branko
MAR-128: Upgraded tests for php_website role:

- Switch to new Molecule configuration.
- Updated set-up playbook to use become: yes.
- Moved some preparatory steps outside of the main playbook (eases
idempotence tests).
- Updated tests to reference the yml inventory file.
- Updated tests to use new fixture (host instead of individual ones).
- Switched to extracting hostname instead of hard-coding it in a
couple of tests.
- Fixed some linting issues.
- Updated hostname to include Debian version.
---

- hosts: parameters-mandatory
  become: yes
  roles:
    - role: mail_server
      mail_ldap_base_dn: dc=local
      mail_ldap_url: ldap://ldap-server/
      mail_ldap_postfix_password: postfixpassword
      mail_ldap_dovecot_password: dovecotpassword

      # Common parameters (general, not role).
      tls_certificate_dir: tests/data/x509/
      tls_private_key_dir: tests/data/x509/

      # common
      ca_certificates:
        testca: "{{ lookup('file', 'tests/data/x509/ca.cert.pem') }}"

- hosts: parameters-optional
  become: yes
  roles:
    - role: mail_server
      mail_ldap_base_dn: dc=local
      mail_ldap_url: ldap://ldap-server/
      mail_ldap_tls_truststore: "{{ lookup('file', 'tests/data/x509/ca.cert.pem') }}"
      mail_ldap_postfix_password: postfixpassword
      mail_ldap_dovecot_password: dovecotpassword
      mail_server_tls_protocols:
        - TLSv1.2
        - TLSv1.1
      mail_server_tls_ciphers: "DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:!aNULL:!MD5:!EXPORT"
      mail_user: virtmail
      mail_user_uid: 5000
      mail_user_gid: 5000
      imap_max_user_connections_per_ip: 2
      imap_tls_certificate: "{{ lookup('file', 'tests/data/x509/parameters-optional_imap.cert.pem') }}"
      imap_tls_key: "{{ lookup('file', 'tests/data/x509/parameters-optional_imap.key.pem') }}"
      local_mail_aliases:
        root: "john.doe@domain1"
      smtp_tls_certificate: "{{ lookup('file', 'tests/data/x509/parameters-optional_smtp.cert.pem') }}"
      smtp_tls_key: "{{ lookup('file', 'tests/data/x509/parameters-optional_smtp.key.pem') }}"
      imap_folder_separator: "."
      smtp_rbl:
        - bl.spamcop.net
        - zen.spamhaus.org

      mail_postmaster: "webmaster@parameters-optional"
      smtp_allow_relay_from:
        - 10.31.127.20

      # common
      ca_certificates:
        testca: "{{ lookup('file', 'tests/data/x509/ca.cert.pem') }}"

      # backup_client
      enable_backup: yes
      backup_client_username: bak-parameters-optional-j64
      backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-optional.asc') }}"
      backup_server: ldap-server
      backup_server_host_ssh_public_keys:
        - "{{ lookup('file', 'tests/data/ssh/server_dsa.pub') }}"
        - "{{ lookup('file', 'tests/data/ssh/server_rsa.pub') }}"
        - "{{ lookup('file', 'tests/data/ssh/server_ed25519.pub') }}"
        - "{{ lookup('file', 'tests/data/ssh/server_ecdsa.pub') }}"
      backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-optional' ) }}"