Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ansible/group_vars/all/websites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,8 @@ websites:
state: "present"
authenticated: true
oauth2_callback_url: "/auth/callback"

- name: "docuseal.{{ canonical_hostname }}"
user: "docuseal"
state: "present"
custom_config: true
2 changes: 2 additions & 0 deletions ansible/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
tags: "studytrip"
- role: "hacc"
tags: "hacc"
- role: "docuseal"
tags: "docuseal"
# We only want to deploy the crazy88 role when specifically requested
- role: "crazy88bot"
tags: ["never", "crazy88bot"]
Expand Down
39 changes: 39 additions & 0 deletions ansible/roles/docuseal/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: "create user for docuseal"
ansible.builtin.user:
name: "docuseal"
home: "/var/www/docuseal"
shell: "/usr/sbin/nologin"
state: "present"
system: true
groups: "docker"
append: true

- name: "copy nginx configuration"
ansible.builtin.template:
src: "docuseal.conf.j2"
dest: "/etc/nginx/sites-available/docuseal.{{ canonical_hostname }}.conf"
notify: "reload nginx"

- name: "enable nginx configuration"
ansible.builtin.file:
src: "/etc/nginx/sites-available/docuseal.{{ canonical_hostname }}.conf"
path: "/etc/nginx/sites-enabled/docuseal.{{ canonical_hostname }}.conf"
state: "link"
notify: "reload nginx"

- name: "set up docuseal"
become_user: "docuseal"
become: true
block:
- name: "copy docker compose file"
ansible.builtin.template:
src: "docker-compose.yml.j2"
dest: "/var/www/docuseal/docker-compose.yml"

- name: "Docker compose"
ansible.builtin.include_tasks: "../docker/tasks/compose-up.yml"
vars:
project_source: "/var/www/docuseal"
remove_images: all
compose_file: "docker-compose.yml"
12 changes: 12 additions & 0 deletions ansible/roles/docuseal/templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
app:
image: docuseal/docuseal:latest
ports:
- 3020:3000
volumes:
- ./docuseal:/data/docuseal
env:
- SMTP_ADDRESS=smtp-relay.gmail.com
- SMTP_PORT=587
- [email protected]
- SMTP_AUTHENTICATION=plain
20 changes: 20 additions & 0 deletions ansible/roles/docuseal/templates/docuseal.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# {{ ansible_managed }}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name docuseal.{{ canonical_hostname }};

ssl_certificate /etc/letsencrypt/live/docuseal.{{ canonical_hostname }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/docuseal.{{ canonical_hostname }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/docuseal.{{ canonical_hostname }}/chain.pem;

location / {
proxy_pass http://localhost:{{ docuseal_port }}/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
2 changes: 2 additions & 0 deletions ansible/roles/docuseal/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
docuseal_port: 3020