vps-ansible/roles/collabora/tasks/apache.yml

32 lines
1.0 KiB
YAML

---
- name: add collabora http site
template:
src: etc/apache2/sites-available/ansible_domain.conf.j2
dest: /etc/apache2/sites-available/{{ ansible_domain }}.conf
owner: root
group: root
mode: 0644
- name: disable default site and enable collabora site
block:
- name: disable default site
command:
cmd: a2dissite 000-default.conf
- name: enable collabora site
command:
cmd: a2ensite {{ ansible_domain }}.conf
notify: reload apache
- name: run certbot
command:
cmd: certbot --apache --non-interactive --keep-until-expiring --no-eff-email --redirect --renew-with-new-domains --agree-tos -d {{ ansible_domain }}
- name: add collabora https site
template:
src: etc/apache2/sites-available/ansible_domain-le-ssl.conf.j2
dest: /etc/apache2/sites-available/{{ ansible_domain }}-le-ssl.conf
owner: root
group: root
mode: 0644
- name: enable collabora https site
command:
cmd: a2ensite {{ ansible_domain }}-le-ssl.conf
notify: restart apache