--- - name: configure roundcube-core ansible.builtin.debconf: name: roundcube-core question: "{{ item.key }}" value: "{{ item.value }}" vtype: "{{ item.type }}" loop: - { key: 'roundcube/database-type', type: 'select', value: 'sqlite3' } - { key: 'roundcube/db/basepath', type: 'string', value: '/var/lib/roundcube/' } tags: - roundcube - name: install Roundcube ansible.builtin.apt: name: - imapproxy - roundcube - roundcube-sqlite3 - roundcube-plugins - php-net-sieve - php-zip state: present tags: - roundcube - name: configure imapproxy imap host ansible.builtin.lineinfile: dest: /etc/imapproxy.conf regexp: "^server_hostname" line: "server_hostname {{ roundcube_imap_host }}" notify: restart imapproxy tags: - roundcube - name: configure imapproxy imap port ansible.builtin.lineinfile: dest: /etc/imapproxy.conf regexp: "^server_port" line: "server_port {{ roundcube_imap_port }}" notify: reload imapproxy tags: - roundcube - name: enable and start imapproxy ansible.builtin.service: name: imapproxy state: started enabled: True tags: - roundcube - name: configure roundcube imap host ansible.builtin.lineinfile: dest: /etc/roundcube/config.inc.php regexp: "\\$config\\['default_host'\\]" line: "$config['default_host'] = array('127.0.0.1');" tags: - roundcube - name: configure roundcube imap port ansible.builtin.lineinfile: dest: /etc/roundcube/config.inc.php regexp: "\\$config\\['default_port'\\]" insertafter: "\\$config\\['default_host'\\]" line: "$config['default_port'] = 1143;" tags: - roundcube - name: configure roundcube smtp port ansible.builtin.lineinfile: dest: /etc/roundcube/config.inc.php regexp: "\\$config\\['smtp_port'\\]" insertafter: "\\$config\\['smtp_port'\\]" line: "$config['smtp_port'] = 25;" tags: - roundcube - name: configure managesieve plugin ansible.builtin.copy: src: /usr/share/roundcube/plugins/managesieve/config.inc.php.dist dest: /etc/roundcube/plugins/managesieve/config.inc.php mode: "0644" remote_src: True tags: - roundcube - name: enable default plugins ansible.builtin.replace: dest: /etc/roundcube/config.inc.php regexp: "^\\$config\\['plugins'\\] = array\\($" replace: "$config['plugins'] = array('zipdownload','managesieve'" tags: - roundcube - name: deploy apache roundcube vhost ansible.builtin.template: src: apache2.conf.j2 dest: /etc/apache2/sites-available/roundcube.conf mode: "0640" notify: reload apache2 when: roundcube_webserver == "apache" tags: - roundcube - name: enable apache roundcube vhost ansible.builtin.file: src: /etc/apache2/sites-available/roundcube.conf dest: /etc/apache2/sites-enabled/roundcube.conf state: link force: true notify: reload apache2 when: roundcube_webserver == "apache" tags: - roundcube - name: deploy Nginx roundcube vhost ansible.builtin.template: src: nginx.conf.j2 dest: /etc/nginx/sites-available/roundcube.conf when: roundcube_webserver == "nginx" notify: reload nginx - name: enable Nginx roundcube vhost ansible.builtin.file: src: "/etc/nginx/sites-available/roundcube.conf" dest: "/etc/nginx/sites-enabled/roundcube.conf" state: link when: roundcube_webserver == "nginx" notify: reload nginx - name: enable roundcube link in default site index ansible.builtin.lineinfile: dest: /var/www/index.html state: present regexp: "Webmail" line: '
  • Webmail
  • ' insertbefore: "" tags: - roundcube