diff --git a/group_vars/certbot.yml b/group_vars/certbot.yml index 3dd13db9..89ae3297 100644 --- a/group_vars/certbot.yml +++ b/group_vars/certbot.yml @@ -1,6 +1,6 @@ --- glob_certbot: - dns_rfc2136_server: '172.16.10.147' + dns_rfc2136_server: '185.230.79.9' dns_rfc2136_name: certbot_challenge. dns_rfc2136_secret: "{{ vault_certbot_dns_secret }}" mail: root@crans.org diff --git a/group_vars/horde.yml b/group_vars/horde.yml index 11ea1957..1e5ba890 100644 --- a/group_vars/horde.yml +++ b/group_vars/horde.yml @@ -1,9 +1,9 @@ glob_horde: secret: '{{ vault_horde_secret }}' imap: imap.adm.crans.org - smtp: smtp.crans.org + smtp: smtp.adm.crans.org maildomain: crans.org - db: thot.adm.crans.org + db: pgsql.adm.crans.org admins: - "'paulon'" - "'vulcain'" @@ -16,5 +16,5 @@ glob_horde: dest_hostname : webmail.crans.org admin_src_hostname : horde.adm.crans.org admin_dest_hostname : webmail.adm.crans.org - zone_ipv4 : 10.231.136.0/24 - zone_ipv6 : 2a0c:700:0:2::/64 + zone_ipv4 : 172.16.10.0/24 + zone_ipv6 : fd00:0:0:10::/64 diff --git a/group_vars/reverseproxy.yml b/group_vars/reverseproxy.yml index 11b54f65..15ba99aa 100644 --- a/group_vars/reverseproxy.yml +++ b/group_vars/reverseproxy.yml @@ -29,8 +29,6 @@ nginx: # - {from: roundcube.crans.org, to: 10.231.136.105} # - {from: phabricator.crans.org, to: 10.231.136.123} # - {from: trackerusercontent.crans.org, to: 10.231.136.123} - # - {from: webmail.crans.org, to: 10.231.136.107} - # - {from: horde.crans.org, to: 10.231.136.107} # - {from: owncloud.crans.org, to: 10.231.136.26} # - {from: ftps.crans.org, to: 10.231.136.98} # - {from: wiki.crans.org, to: 10.231.136.204} @@ -44,6 +42,8 @@ nginx: # - {from: autoconfig.crans.org, to: 10.231.136.46} # - {from: grafana.crans.org, to: "10.231.136.102:3000"} # - {from: webirc.crans.org, to: "10.231.136.1:9000"} + - {from: webmail.crans.org, to: 172.16.10.108} + - {from: horde.crans.org, to: 172.16.10.108} - {from: framadate.crans.org, to: 172.16.10.109} - {from: stream.crans.org, to: 172.16.10.118} - {from: cas.crans.org, to: 172.16.10.120} @@ -55,7 +55,7 @@ nginx: - {from: pad.crans.org, to: "172.16.10.130:9001"} - {from: zero.crans.org, to: 172.16.10.130} - {from: ethercalc.crans.org, to: "172.16.10.133:8000"} - - {from: belenios.crans.org, to: 172.16.10.111} + # - {from: belenios.crans.org, to: 172.16.10.111} # - {from: mailman.crans.org, to: 10.231.136.180} # # # Zamok diff --git a/host_vars/hodaur.adm.crans.org.yml b/host_vars/hodaur.adm.crans.org.yml new file mode 100644 index 00000000..2aa4c194 --- /dev/null +++ b/host_vars/hodaur.adm.crans.org.yml @@ -0,0 +1,3 @@ +--- +loc_certbot: + domains: "crans.org, *.crans.org, crans.fr, *.crans.fr, crans.eu, *.crans.eu" diff --git a/host_vars/horde-srv.adm.crans.org.yml b/host_vars/horde-srv.adm.crans.org.yml deleted file mode 100644 index 54e2e5fc..00000000 --- a/host_vars/horde-srv.adm.crans.org.yml +++ /dev/null @@ -1,2 +0,0 @@ -loc_horde: - ipv6: '[2a0c:700:0:2:5474:8dff:fe5d:e2be]' diff --git a/host_vars/horde.adm.crans.org.yml b/host_vars/horde.adm.crans.org.yml new file mode 100644 index 00000000..f0914f81 --- /dev/null +++ b/host_vars/horde.adm.crans.org.yml @@ -0,0 +1,3 @@ +loc_horde: + ipv6: 'fd00::10:400:ff:fe01:810' + ipv4: '172.16.10.108' diff --git a/hosts b/hosts index 33934acf..e0eaaaaf 100644 --- a/hosts +++ b/hosts @@ -28,13 +28,13 @@ gitzly.adm.crans.org [certbot:children] radius # We use certbot to manage LE certificates +reverseproxy [nginx_rtmp] fluxx.adm.crans.org [reverseproxy] hodaur.adm.crans.org -frontdaur.adm.crans.org [roundcube] roundcube-srv.adm.crans.org @@ -43,7 +43,7 @@ roundcube-srv.adm.crans.org ethercalc-srv.adm.crans.org [horde] -horde-srv.adm.crans.org +horde.adm.crans.org [radius] routeur-sam.adm.crans.org @@ -107,6 +107,7 @@ tracker.adm.crans.org jitsi.adm.crans.org #ethercalc-srv.adm.crans.org kenobi.adm.crans.org +horde.adm.crans.org [ovh_physical] sputnik.adm.crans.org diff --git a/plays/horde.yml b/plays/horde.yml index bc775369..f1b8aa8d 100755 --- a/plays/horde.yml +++ b/plays/horde.yml @@ -2,5 +2,7 @@ --- # Moi j'aime le ocaml et lui il installe horde - hosts: horde + vars: + horde: '{{ glob_horde | default({}) | combine(loc_horde | default({})) }}' roles: - horde diff --git a/plays/reverse-proxy.yml b/plays/reverse-proxy.yml index b7a8d3ad..0e25fc50 100755 --- a/plays/reverse-proxy.yml +++ b/plays/reverse-proxy.yml @@ -1,6 +1,9 @@ #!/usr/bin/env ansible-playbook --- - hosts: reverseproxy + vars: + certbot: '{{ glob_certbot | default({}) | combine(loc_certbot | default({})) }}' + mirror: '{{ glob_mirror.name }}' roles: - certbot - nginx-reverseproxy diff --git a/roles/horde/README.md b/roles/horde/README.md index 874a42e6..133011b6 100644 --- a/roles/horde/README.md +++ b/roles/horde/README.md @@ -2,7 +2,7 @@ Ce rôle ansible deploie une instance du webmail horde. ## Variables - - glob_horde. : + - horde. : - secret : le secret de horde - imap : le serveur imap - smtp : le serveur smtp (il doit juste être contactable depuis le serveur diff --git a/roles/horde/tasks/main.yml b/roles/horde/tasks/main.yml index f08addf0..aa7dd9ac 100644 --- a/roles/horde/tasks/main.yml +++ b/roles/horde/tasks/main.yml @@ -3,9 +3,13 @@ - name: Install horde APT dependencies apt: update_cache: true - name: - - nginx - - php-horde-webmail + name: '{{ item }}' + loop: # Install dependencies in the right order. + - nginx + - php7.3-fpm + - php-horde-webmail + - php-pgsql + - oidentd register: apt_result retries: 3 until: apt_result is succeeded @@ -21,6 +25,23 @@ - horde/horde/conf.php - horde/imp/backends.php +- name: Enable horde plugins + template: + src: 'horde/{{ item }}/conf.php.j2' + dest: '/etc/horde/{{ item }}/conf.php' + owner: www-data + group: www-data + mode: 0640 + loop: + - gollem + - imp + - ingo + - kronolith + - mnemo + - nag + - trean + - turba + - name: Configure nginx site template: src: '{{ item }}.j2' diff --git a/roles/horde/templates/horde/gollem/conf.php.j2 b/roles/horde/templates/horde/gollem/conf.php.j2 new file mode 100644 index 00000000..abd03a53 --- /dev/null +++ b/roles/horde/templates/horde/gollem/conf.php.j2 @@ -0,0 +1,8 @@ +{{ ansible_header | comment(decoration='// ') }} + + false, 'name' => 'IMAP Cr@ns', - 'hostspec' => '{{ glob_horde.imap }}', + 'hostspec' => '{{ horde.imap }}', 'hordeauth' => true, 'protocol' => 'imap', 'port' => 143, 'secure' => 'tls', - 'maildomain' => '{{ glob_horde.maildomain }}', + 'maildomain' => '{{ horde.maildomain }}', 'smtp' => array( - 'host' => '{{ glob_horde.smtp }}', + 'host' => '{{ horde.smtp }}', 'port' => 25, ), 'cache' => false, diff --git a/roles/horde/templates/horde/imp/conf.php.j2 b/roles/horde/templates/horde/imp/conf.php.j2 new file mode 100644 index 00000000..31ee99c4 --- /dev/null +++ b/roles/horde/templates/horde/imp/conf.php.j2 @@ -0,0 +1,22 @@ +{{ ansible_header | comment(decoration='// ') }} + +