Getting started¶
Default setup¶
If you don't specify any configuration values, the role will setup a Nginx
HTTP server running a default installation of the latest Roundcube stable
release which is then accessible via https://roundcube.<your-domain>
.
SQLite is used as database backend for storing the user settings.
Example inventory¶
Roundcube can be installed on a given host by adding it to the
[debops_service_roundcube]
Ansible inventory group:
[debops_service_roundcube]
hostname
Example playbook¶
The following playbook can be used with DebOps. If you are using these role without DebOps you might need to adapt them to make them work in your setup.
---
- name: Manage Roundcube Web mail
hosts: [ 'debops_service_roundcube' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: debops.php/env
tags: [ 'role::php', 'role::php:env' ]
- role: debops.apt_preferences
tags: [ 'role::apt_preferences', 'role::nginx', 'role::php' ]
apt_preferences__dependent_list:
- '{{ nginx__apt_preferences__dependent_list }}'
- '{{ php__apt_preferences__dependent_list }}'
- role: debops.logrotate
tags: [ 'role::logrotate' ]
logrotate__dependent_config:
- '{{ php__logrotate__dependent_config }}'
- role: debops.ferm
tags: [ 'role::ferm', 'role::nginx' ]
ferm__dependent_rules:
- '{{ nginx__ferm__dependent_rules }}'
- role: debops.php
tags: [ 'role::php' ]
php__dependent_packages:
- '{{ roundcube__php__dependent_packages }}'
php__dependent_pools:
- '{{ roundcube__php__dependent_pools }}'
- role: debops.nginx
tags: [ 'role::nginx' ]
nginx__dependent_servers:
- '{{ roundcube__nginx__dependent_servers }}'
nginx__dependent_upstreams:
- '{{ roundcube__nginx__dependent_upstreams }}'
- role: debops.mariadb
tags: [ 'role::mariadb' ]
mariadb__dependent_users:
- database: '{{ roundcube__database_map[roundcube__database].dbname }}'
user: '{{ roundcube__database_map[roundcube__database].dbuser }}'
password: '{{ roundcube__database_map[roundcube__database].dbpass }}'
owner: '{{ roundcube__user }}'
group: '{{ roundcube__group }}'
home: '{{ roundcube__home }}'
system: True
priv_aux: False
mariadb__server: '{{ roundcube__database_map[roundcube__database].dbhost }}'
when: roundcube__database_map[roundcube__database].dbtype == 'mysql'
- role: debops-contrib.roundcube
tags: [ 'role::roundcube' ]
This playbook is also shipped with the role under docs/playbooks/
.
Ansible tags¶
You can use Ansible --tags
or --skip-tags
parameters to limit what
tasks are performed during Ansible run. This can be used after a host was first
configured to speed up playbook execution, when you are sure that most of the
configuration is already in the desired state.
Available role tags:
role::roundcube
- Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.
role::roundcube:pkg
- Run tasks related to system package installation.
role::roundcube:deployment
- Run tasks related to the application deployment and update.
role::roundcube:config
- Run tasks related to the Roundcube application configuration.
role::roundcube:database
- Run tasks related to setup or update the database user and schema.