mxdomain website

This commit is contained in:
Geno 2020-10-11 12:06:32 +02:00
parent 6631d4fd99
commit 8703443268
4 changed files with 45 additions and 0 deletions

View File

@ -61,3 +61,8 @@
import_tasks: roundcubemail.yml import_tasks: roundcubemail.yml
tags: roundcubemail tags: roundcubemail
- name: Run MX-Domain Website
when: mailserver_website != ""
import_tasks: website.yml
tags: website

23
tasks/website.yml Normal file
View File

@ -0,0 +1,23 @@
- name: website - get cert for nginx domain
notify: dehydrated
when: mailserver_mx_domain != ""
lineinfile:
path: /etc/dehydrated/domains.txt
line: "{{ mailserver_mx_domain }}"
- name: website - nginx domain
notify: reload nginx
when: mailserver_mx_domain != ""
template:
src: mxdomain-website-domain.nginx
dest: /etc/nginx/sites.d/mxdomain.act
- name: website - directory
file:
state: directory
path: "/srv/http/{{ mailserver_mx_domain }}"
- name: website - index.html
template:
src: mxdomain-website.html
dest: "/srv/http/{{ mailserver_mx_domain }}/index.html"

View File

@ -0,0 +1,14 @@
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name {{ mailserver_mx_domain }};
ssl_certificate /etc/dehydrated/certs/{{ mailserver_mx_domain }}/fullchain.pem;
ssl_certificate_key /etc/dehydrated/certs/{{ mailserver_mx_domain }}/privkey.pem;
include snippets/letsencrypt.conf;
root /srv/http/{{ mailserver_mx_domain }};
index index.html index.htm index.php;
}

View File

@ -0,0 +1,3 @@
<h1>Mailserver: {{mailserver_mx_domain}}</h1>
This is a Mailserver from
<a href="https://{{mailserver_website}}">{{mailserver_website}}</a>