ansible-role-mailserver/tasks/website.yml

26 lines
686 B
YAML

- name: website - get cert for nginx domain
notify: dehydrated
when: mailserver_mx_domain != ""
lineinfile:
path: /etc/dehydrated/domains.txt
regexp: '(.+){{ mailserver_mx_domain }}(.*)?'
line: '\1{{ mailserver_mx_domain }}\2'
backrefs: yes
- 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"