Add mastodon service
This commit is contained in:
2
roles/ssl-cert/defaults/main.yml
Normal file
2
roles/ssl-cert/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
installcertbot: false
|
||||
25
roles/ssl-cert/tasks/main.yml
Normal file
25
roles/ssl-cert/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Install openssl
|
||||
apt:
|
||||
name: openssl
|
||||
state: present
|
||||
|
||||
- name: install Certbot Nginx plugin
|
||||
apt:
|
||||
name: python3-certbot
|
||||
when: installCertbot == True
|
||||
|
||||
- name: Create Directory for Domain self-signed
|
||||
file:
|
||||
path: /etc/ssl/{{ domain }}
|
||||
state: directory
|
||||
mode: '0755'
|
||||
when: installCertbot == False
|
||||
|
||||
- name: Create self-signed certificate, if configured.
|
||||
shell: "openssl req -x509 -nodes -subj '/CN={{ domain }}' -days 365 -newkey rsa:4096 -sha256 -keyout /etc/server/{{ domain }}/server.key -out /etc/server/{{ domain }}/server.crt"
|
||||
when: installCertbot == False
|
||||
|
||||
- name: Create self-signed certificate, if configured.
|
||||
shell: "certbot -certonly -d {{ domain }} --nginx -m contact@bim.land --agree-tos"
|
||||
when: installCertbot == True
|
||||
Reference in New Issue
Block a user