2018-04-09 21:28:36 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install packages
|
2020-11-13 18:29:32 +01:00
|
|
|
apt:
|
|
|
|
name:
|
2022-09-02 21:11:04 +02:00
|
|
|
- docker-compose
|
2018-04-09 21:28:36 +02:00
|
|
|
|
2022-09-02 21:11:04 +02:00
|
|
|
- name: Create hedgedoc group
|
|
|
|
group: name=hedgedoc
|
2018-10-15 18:46:34 +02:00
|
|
|
|
2022-09-02 21:11:04 +02:00
|
|
|
- name: Create hedgedoc user
|
|
|
|
user:
|
|
|
|
name: hedgedoc
|
|
|
|
home: /opt/hedgedoc
|
|
|
|
shell: /bin/bash
|
|
|
|
group: hedgedoc
|
|
|
|
groups: docker
|
2019-09-06 16:17:34 +02:00
|
|
|
|
2022-09-02 21:11:04 +02:00
|
|
|
- name: Configure hedgedoc container
|
|
|
|
template: src=docker-compose.yml.j2 dest=/opt/hedgedoc/docker-compose.yml
|
2021-05-13 16:19:43 +02:00
|
|
|
notify: Restart hedgedoc
|
2018-04-09 21:28:36 +02:00
|
|
|
|
|
|
|
- name: Ensure certificates are available
|
2021-05-13 16:19:43 +02:00
|
|
|
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ hedgedoc_domain }}.key -out /etc/nginx/ssl/{{ hedgedoc_domain }}.crt -days 730 -subj "/CN={{ hedgedoc_domain }}" creates=/etc/nginx/ssl/{{ hedgedoc_domain }}.crt
|
2018-04-09 21:28:36 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2021-05-13 16:19:43 +02:00
|
|
|
- name: Configure certificate manager for hedgedoc
|
|
|
|
template: src=certs.j2 dest=/etc/acertmgr/{{ hedgedoc_domain }}.conf
|
2019-02-23 23:54:24 +01:00
|
|
|
notify: Run acertmgr
|
2018-04-09 21:28:36 +02:00
|
|
|
|
|
|
|
- name: Configure vhost
|
2021-05-13 16:19:43 +02:00
|
|
|
template: src=vhost.j2 dest=/etc/nginx/sites-available/hedgedoc
|
2018-04-09 21:28:36 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
|
|
|
- name: Enable vhost
|
2021-05-13 16:19:43 +02:00
|
|
|
file: src=/etc/nginx/sites-available/hedgedoc dest=/etc/nginx/sites-enabled/hedgedoc state=link
|
2018-04-09 21:28:36 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2021-05-13 16:19:43 +02:00
|
|
|
- name: Systemd unit for hedgedoc
|
|
|
|
template: src=hedgedoc.service.j2 dest=/etc/systemd/system/hedgedoc.service
|
2018-04-09 21:28:36 +02:00
|
|
|
notify:
|
|
|
|
- Reload systemd
|
2021-05-13 16:19:43 +02:00
|
|
|
- Restart hedgedoc
|
2018-04-09 21:28:36 +02:00
|
|
|
|
2021-05-13 16:19:43 +02:00
|
|
|
- name: Start the hedgedoc service
|
|
|
|
service: name=hedgedoc state=started enabled=yes
|
2022-06-06 20:35:14 +02:00
|
|
|
|
|
|
|
- name: Enable monitoring
|
|
|
|
include_role: name=icinga-monitor tasks_from=http
|
|
|
|
vars:
|
|
|
|
vhost: "{{ hedgedoc_domain }}"
|