Skip to content
Snippets Groups Projects
Commit 8d8c212f authored by ynerant's avatar ynerant Committed by ynerant
Browse files

[nginx/roundcube] Factorize configuration


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent 4c115a8b
No related branches found
No related tags found
1 merge request!165Nginx
roundcube_glob:
glob_roundcube:
name: Crans
imap_server: owl.adm.crans.org
smtp_server: smtp.adm.crans.org
......@@ -29,3 +29,4 @@ roundcube_glob:
elastic: https://www.crans.org/images/crans.svg
larry: https://www.crans.org/images/crans_banner.png
classic: https://www.crans.org/images/crans_banner.png
......@@ -2,3 +2,25 @@
interfaces:
adm: eth0
srv_nat: eth1
loc_nginx:
service_name: "roundcube"
ssl: []
servers:
- server_name:
- "roundcube.adm.crans.org"
default: true
root: "/var/lib/roundcube"
locations:
- filter: "~ \\.php$"
params:
- "include snippets/fastcgi-php.conf"
- "fastcgi_buffer_size 128k"
- "fastcgi_buffers 4 256k"
- "fastcgi_busy_buffers_size 256k"
- "fastcgi_pass unix:/var/run/php/php7.3-fpm.sock"
- "include fastcgi_params"
additional_params:
- "index index.php index.htm index.html"
- "try_files $uri $uri/ /index.php?q=$uri&$args"
- "client_max_body_size 10G"
......@@ -90,6 +90,7 @@ charybde.adm.crans.org
[nginx:children]
mailman
reverseproxy
roundcube
thelounge
[ntp_server]
......
......@@ -3,6 +3,8 @@
- hosts: roundcube
vars:
roundcube: '{{ roundcube_glob | default({}) | combine(roundcube_loc | default({})) }}'
nginx: '{{ glob_nginx | default({}) | combine(loc_nginx | default({})) }}'
roundcube: '{{ glob_roundcube | default({}) | combine(loc_roundcube | default({})) }}'
roles:
- roundcube
- nginx
......@@ -4,7 +4,6 @@
update_cache: true
install_recommends: false
name:
- nginx
- roundcube
- roundcube-pgsql
- roundcube-plugins
......@@ -52,19 +51,6 @@
loop: "{{ roundcube.plugins }}"
when: item.repo is defined
- name: Copy NGINX site
template:
src: nginx/roundcube.j2
dest: /etc/nginx/sites-available/roundcube
notify: Restart nginx
- name: Activate NGINX site
file:
src: /etc/nginx/sites-available/roundcube
dest: /etc/nginx/sites-enabled/roundcube
state: link
notify: Restart nginx
- name: Indicate role in motd
template:
src: update-motd.d/05-service.j2
......
{{ ansible_header | comment }}
server {
listen roundcube.adm.crans.org:80;
listen [2a0c:700:0:2:6809:acff:fe67:47e6]:80;
server_name roundcube.adm.crans.org;
root /var/lib/roundcube;
index index.php index.htm index.html;
try_files $uri $uri/ /index.php?q=$uri&$args;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
include fastcgi_params;
}
set_real_ip_from 10.231.136.0/24;
set_real_ip_from 2a0c:700:0:2::/64;
real_ip_header P-Real-Ip;
client_max_body_size 10G;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment