  - name: Install apache2
    tags: roundcube
    include_role:
      name: 'general/apache2'

  - name: Install Postgres
    tags: roundcube
    include_role:
      name: 'general/postgresql'

  # install ssl certs and key
  # certs and keys are locally stored in ./internalit/roles/ldap/files
  - name: apache2 copy SSL cert
    become: true
    tags: roundcube
    ansible.builtin.copy:
      src: "../../ldap/files/{{ inventory_hostname }}.perfact.de.pem"
      dest: "/etc/apache2/private/{{ inventory_hostname }}.perfact.de.pem"
    notify: restart apache2

  - name: apache2 copy SSL key
    become: true
    tags: roundcube
    ansible.builtin.copy:
      src: "../../ldap/files/{{ inventory_hostname }}.perfact.de.key"
      dest: "/etc/apache2/private/{{ inventory_hostname }}.perfact.de.key"
    notify: restart apache2

  - name: add security setting recommended by roundcube
    become: true
    tags: roundcube
    ansible.builtin.template:
      src: "80-perfact-php-roundcounde.conf"
      dest: "/etc/php/8.2/apache2/conf.d/80-perfact-php-roundcounde.conf"
      mode: '0644'
