Compare commits

36 Commits

Author SHA1 Message Date
Mauro Torrez
aef469fa91 use postfix submission 2019-10-02 20:58:44 -03:00
Mauro Torrez
35cd435135 use tls by default for connecting to mail server 2019-10-02 19:02:27 -03:00
Mauro Torrez
769c69f166 Merge branch 'master' of https://git.mau.ro/mauro/ansible-role-roundcube-docker 2019-10-02 16:20:14 -03:00
Mauro Torrez
9f8f664ed7 roundcube version 2019-10-02 16:20:05 -03:00
33eda44c16 recursive combine 2019-10-02 13:14:05 +00:00
Mauro Torrez
23aba0b59e dont use tls - breaks serving static files 2019-10-02 01:22:18 -03:00
Mauro Torrez
188f7f87ac allow self-signed certs on mail server 2019-10-02 00:49:40 -03:00
Mauro Torrez
1378d4d677 tls support 2019-10-02 00:09:03 -03:00
Mauro Torrez
9fbe0c3a20 default connection parameters 2019-10-01 23:16:24 -03:00
Mauro Torrez
18fb1c7445 add trailing slash to location 2019-10-01 23:12:23 -03:00
Mauro Torrez
d66cd019d6 use eumau/roundcube image + nginx auto config 2019-10-01 22:52:37 -03:00
Mauro Torrez
e5507857df proxy redirect 2019-09-06 01:16:30 -03:00
Mauro Torrez
d8ce72e9d1 fix meta tag 2019-09-06 01:03:08 -03:00
Mauro Torrez
5d36d9edc5 netter nging location definition 2019-09-06 00:44:48 -03:00
Mauro Torrez
a9ff4f484b fix docker image name 2019-09-05 23:48:15 -03:00
Mauro Torrez
4c6f2f31da create mysql db only if required 2019-09-05 23:45:18 -03:00
Mauro Torrez
b049fb68a9 roundcube 2019-09-05 23:36:23 -03:00
Mauro Torrez
2610cd4ef1 inicial nextcloud 2019-08-29 00:57:53 -03:00
Mauro Torrez
ed73b0bc2e arreglo nombre 2019-08-28 18:34:57 -03:00
Mauro Torrez
f04a93096a corrijo error 2019-08-28 18:32:26 -03:00
Mauro Torrez
a47d2c8380 commit inicial 2019-08-28 18:13:39 -03:00
003e1c0cd4 actualizo config nginx 2019-08-28 10:17:56 -03:00
5b0ef38aad no port binding 2019-08-28 09:53:17 -03:00
2b44725360 usar apache en vez de fpm 2019-08-28 09:43:44 -03:00
Mauro Torrez
0c237c3be3 elimino puertos publicados -- se requiere FE 2019-08-28 01:21:57 -03:00
Mauro Torrez
98700949b7 config db 2019-08-28 01:19:30 -03:00
Mauro Torrez
8a4581ad65 arreglo usuario mysql 2019-08-28 01:15:38 -03:00
Mauro Torrez
76b464bab5 arreglopuertos 2019-08-28 01:13:32 -03:00
Mauro Torrez
8a0c733440 debugging 1 2019-08-28 01:12:38 -03:00
Mauro Torrez
1b0bb82bb2 fix 5 2019-08-28 00:38:21 -03:00
Mauro Torrez
34f09097df bugfix 4 2019-08-28 00:35:06 -03:00
Mauro Torrez
d6694d5a3e bugfix 3 2019-08-28 00:33:53 -03:00
Mauro Torrez
7d6f8e6ade bugfix 2 2019-08-28 00:32:48 -03:00
Mauro Torrez
2e8cafaa33 bugfix 1 2019-08-28 00:28:13 -03:00
Mauro Torrez
e6f31d527b config inicial 2019-08-28 00:24:31 -03:00
Mauro Torrez
9c3d8e4300 renombro mysql -> mariadb 2019-08-27 18:36:50 -03:00
3 changed files with 128 additions and 34 deletions

View File

@@ -1,3 +1,3 @@
# ansible-role-mysql-docker # ansible-role-mariadb-docker
Instalar mysql via Docker Este rol permite instalar mariadb en Docker.

View File

@@ -1,20 +1,39 @@
--- ---
# domain, webroot
roundcube_domain: default
roundcube_web_root: /roundcube
roundcube_version: 1.3.10
# container # container
mysql_image: mysql roundcube_image: eumau/roundcubemail:{{ roundcube_version }}
mysql_container_name: mysql roundcube_container: roundcube
mysql_volume: mysql roundcube_volume: roundcube
# clave del usuario root (CAMBIAR) # mysql, mariadb, postgresql
mysql_root_password: password roundcube_db_type: sqlite
roundcube_db_host: localhost
roundcube_db_port: "{{ '5432' if 'post' in roundcube_db_type else '3306' }}"
roundcube_db_user: roundcube
roundcube_db_password: password
roundcube_db_name:
roundcube{{ '.sqlite' if roundcube_db_type == 'sqlite' else '' }}
# base de datos y usuario (opcionales) # data dir (inside container)
# mysql_database: db roundcube_data_dir: /var/www/html
# mysql_user: db_user
# mysql_password: db_pass
# binding del puerto mysql # imap
mysql_bind_host: 127.0.0.1 roundcube_imap_host: "tls://{{ dovecot_container | default('localhost') }}"
mysql_bind_port: 3306 roundcube_imap_port: "143"
# smtp
roundcube_smtp_host: "tls://{{ postfix_container | default('localhost') }}"
roundcube_smtp_port: "587"
# plugins
roundcube_plugins: []
# upload max filesize
roundcube_upload_max_filesize: 40M
# definido por rol docker # definido por rol docker
docker_network_name: dockernet docker_network_name: dockernet

View File

@@ -1,33 +1,108 @@
--- ---
- name: start mysql container # TODO: postgres support
# - name: create roundcube database (pg)
# postgresql_db:
# state: present
# name: "{{ roundcube_db_name }}"
# login_host: "{{ postgresql_host }}"
# login_port: "{{ postgresql_port }}"
# login_user: "{{ postgresql_root_password }}"
# login_password: "{{ postgresql_root_password }}"
# - name: create roundcube db user (pg)
# postgresql_user:
# state: present
# name: "{{ roundcube_db_user }}"
# password: "{{ roundcube_db_password }}"
# priv: "{{ roundcube_db_name }}.*:ALL"
# login_host: "{{ postgresql_host }}"
# login_port: "{{ postgresql_port }}"
# login_user: root
# login_password: "{{ postgresql_root_password }}"
- name: create roundcube database
mysql_db:
state: present
name: "{{ roundcube_db_name }}"
login_host: "{{ mariadb_host }}"
login_port: "{{ mariadb_port }}"
login_user: root
login_password: "{{ mariadb_root_password }}"
when: roundcube_db_type in ('mariadb','mysql')
- name: create roundcube db user
mysql_user:
state: present
name: "{{ roundcube_db_user }}"
host: "%"
password: "{{ roundcube_db_password }}"
priv: "{{ roundcube_db_name }}.*:ALL"
login_host: "{{ mariadb_host }}"
login_port: "{{ mariadb_port }}"
login_user: root
login_password: "{{ mariadb_root_password }}"
when: roundcube_db_type in ('mariadb','mysql')
- name: start roundcube container
docker_container: docker_container:
image: "{{ mysql_image }}" image: "{{ roundcube_image }}"
name: "{{ mysql_container_name }}" name: "{{ roundcube_container }}"
volumes: volumes:
- "{{ mysql_volume }}:/var/lib/mysql" - "{{ roundcube_volume }}:/var/www/html"
env: env:
MYSQL_ROOT_PASSWORD: "{{ mysql_root_password }}" ROUNDCUBEMAIL_DEFAULT_HOST: "{{ roundcube_imap_host }}"
MYSQL_DATABASE: "{{ mysql_database | default(omit) }}" ROUNDCUBEMAIL_DEFAULT_PORT: "{{ roundcube_imap_port }}"
MYSQL_USER: "{{ mysql_user | default(omit) }}" ROUNDCUBEMAIL_SMTP_SERVER: "{{ roundcube_smtp_host }}"
MYSQL_PASSWORD: "{{ mysql_password | default(omit) }}" ROUNDCUBEMAIL_SMTP_PORT: "{{ roundcube_smtp_port }}"
ROUNDCUBEMAIL_PLUGINS: "{{ roundcube_plugins | join (',') }}"
ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: "{{ roundcube_upload_max_filesize }}"
ROUNDCUBEMAIL_DB_TYPE: "{{ roundcube_db_type }}"
ROUNDCUBEMAIL_DB_HOST: "{{ roundcube_db_host }}"
ROUNDCUBEMAIL_DB_PORT: "{{ roundcube_db_port }}"
ROUNDCUBEMAIL_DB_USER: "{{ roundcube_db_user }}"
ROUNDCUBEMAIL_DB_PASSWORD: "{{ roundcube_db_password }}"
ROUNDCUBEMAIL_DB_NAME: "{{ roundcube_db_name }}"
networks: networks:
- name: "{{ docker_network_name }}" - name: "{{ docker_network_name }}"
ports: ports:
- "{{ mysql_bind_host }}:{{ mysql_bind_port }}:3306"
- name: inspect mysql volume - name: export nginx config
set_fact:
nginx_config: >-
{{ nginx_config | default({}) | combine({
roundcube_domain: {
"locations": {
roundcube_web_root.rstrip('/')+'/': {
"proxy_pass": "http://{}:9080/".format(roundcube_container)
}
}
}
}, recursive=True) }}
- name: inspect roundcube volume
docker_volume_info: docker_volume_info:
name: "{{ mysql_volume }}" name: "{{ roundcube_volume }}"
register: volinfo register: volinfo
- name: export variables - name: export variables
set_fact: set_fact:
mysql_container_name: "{{ mysql_container_name }}" roundcube_volume: "{{ lookup('vars','roundcube_volume') }}"
mysql_volume: "{{ mysql_volume }}" roundcube_volume_mountpoint: "{{ volinfo.volume.Mountpoint }}"
mysql_volume_mountpoint: "{{ volinfo.volume.Mountpoint }}"
mysql_root_password: "{{ mysql_root_password }}" - name: allow self-signed mail server certs
mysql_database: "{{ mysql_database | default(omit) }}" blockinfile:
mysql_user: "{{ mysql_user | default(omit) }}" state: present
mysql_password: "{{ mysql_password | default(omit) }}" path: "{{ roundcube_volume_mountpoint }}/config/config.inc.php"
mysql_host: localhost block: |
mysql_port: "{{ mysql_bind_port }}" $config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
),
);
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
),
);