diff --git a/group_vars/roundcube.yml b/group_vars/roundcube.yml index 9c32c7d035bcc16f1579e38d840e75781e21a255..903313f5aa15fa7027512894c9dc7728def1ab06 100644 --- a/group_vars/roundcube.yml +++ b/group_vars/roundcube.yml @@ -1,4 +1,4 @@ -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 + diff --git a/host_vars/roundcube.adm.crans.org.yml b/host_vars/roundcube.adm.crans.org.yml index 2eb6f993a4287225249a71040a352e24e4c0e15b..67d59ab3b5c15c7da9b90d213478c7cf28eb9bca 100644 --- a/host_vars/roundcube.adm.crans.org.yml +++ b/host_vars/roundcube.adm.crans.org.yml @@ -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" diff --git a/hosts b/hosts index 3207f3e5f29557af8903ca189dcf799ca65d01c7..a6380b6137b4f980bb3d59f65618c6b913aa0d22 100644 --- a/hosts +++ b/hosts @@ -90,6 +90,7 @@ charybde.adm.crans.org [nginx:children] mailman reverseproxy +roundcube thelounge [ntp_server] diff --git a/plays/roundcube.yml b/plays/roundcube.yml index 996ca7c430a13d790d97e88328c9db124bf35057..c57e892026bde30e596178384c3081772e977d47 100755 --- a/plays/roundcube.yml +++ b/plays/roundcube.yml @@ -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 diff --git a/roles/roundcube/tasks/main.yml b/roles/roundcube/tasks/main.yml index 18745b552ccb6f31c9c89491659f474e014aff3c..a67f90b8f5572659a75966b3ad7e0850aad001a2 100644 --- a/roles/roundcube/tasks/main.yml +++ b/roles/roundcube/tasks/main.yml @@ -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 diff --git a/roles/roundcube/templates/nginx/roundcube.j2 b/roles/roundcube/templates/nginx/roundcube.j2 deleted file mode 100644 index ce34cead1159a09015c976b9d2c370a2523b3639..0000000000000000000000000000000000000000 --- a/roles/roundcube/templates/nginx/roundcube.j2 +++ /dev/null @@ -1,28 +0,0 @@ -{{ 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; -}