Compare commits

...

7 Commits

Author SHA1 Message Date
muppeth 54a3483872 Merge pull request 'Merge staging to main' (#3) from staging into main
Reviewed-on: #3
Reviewed-by: meaz <meaz@no-reply@disroot.org>
2024-04-20 02:29:06 +02:00
muppeth 9c585c643a
last fix 2024-03-09 00:59:40 +01:00
muppeth acfd101148 Merge pull request 'issue-749' (#2) from issue-749 into staging
Reviewed-on: #2
2024-03-08 22:44:37 +00:00
muppeth 6b11e05f63
improved copy_ssl task 2024-03-08 23:44:06 +01:00
muppeth 26793093a0
cert distribution task fix 2024-03-08 23:10:23 +01:00
muppeth 659818149d
added virtualenv to apt list 2024-03-07 10:47:35 +01:00
muppeth 9b71c5754f
improved certificate redistrobution 2024-03-02 00:03:57 +01:00
4 changed files with 42 additions and 10 deletions

View File

@ -9,3 +9,15 @@
name: nginx
state: reloaded
- name: reload prosdy
systemd:
name: prosody
state: reloaded
- name: reload mumble
systemd:
name: mumble-server
state: restarted

View File

@ -1,7 +1,7 @@
---
- name: '[CERT] - Generate or renew certificates'
command: /usr/bin/certbot certonly --key-type ecdsa --agree-tos --keep-until-expiring --non-interactive --webroot --webroot-path {{ letsencrypt_webroot_path }} -m {{ letsencrypt_email }} --domains {{ item.name }} --cert-name {{ item.name }} {{ '--reuse-key = true' if item.reuse_key is defined else '' }} --preferred-chain "ISRG Root X1" {{ '--force-renewal' if item.force_renewal is defined else '' }}
command: /usr/bin/certbot certonly --key-type ecdsa --agree-tos --keep-until-expiring --non-interactive --webroot --webroot-path {{ letsencrypt_webroot_path }} -m {{ letsencrypt_email }} --domains {{ item.name }} --cert-name {{ item.name }} {{ '--reuse-key' if item.reuse_key is defined else '' }} --preferred-chain "ISRG Root X1" {{ '--force-renewal' if item.force_renewal is defined else '' }}
with_items: "{{ letsencrypt_domains }}"
notify:
- reload nginx

View File

@ -8,6 +8,7 @@
- python3-venv
- libaugeas0
- ca-certificates
- virtualenv
- name: '[CERTBOT] - Create app dir'
file:

View File

@ -1,20 +1,39 @@
---
- name: '[COPY SSL] - Fetch SSL Certificates'
- name: '[COPY SSL] - Fetch Certificates'
synchronize:
mode: pull
src: '/etc/letsencrypt/'
src: '/etc/letsencrypt/live'
dest: '/etc/ansible/ssl/{{ inventory_hostname }}'
copy_links: 'true'
when: install_letsencrypt == 'true'
notify:
- reload nginx
- name: '[COPY SSL] - Copy SSL certificates to containers behind proxy'
synchronize:
src: '/etc/ansible/ssl/{{ item.name }}/'
dest: '/etc/letsencrypt/'
- name: '[COPY CERTS] - Make sure direcotry permissions to cert path is correct'
file:
path: '/etc/letsencrypt/live/{{ item.domain }}'
state: 'directory'
owner: '{{ item.owner }}'
group: '{{ item.group }}'
when: letsencrypt_copy_certs == 'true'
with_items: '{{ letsencrypt_copy_cert_from }}'
loop: '{{ letsencrypt_copy_cert_from }}'
- name: '[COPY CERTS] - Copy certs archive to webservers'
synchronize:
src: '/etc/ansible/ssl/{{ item.server }}/live/{{ item.domain }}'
dest: '/etc/letsencrypt/live/'
copy_links: 'true'
when: letsencrypt_copy_certs == 'true'
loop: '{{ letsencrypt_copy_cert_from }}'
notify:
- reload nginx
- reload {{ item.service }}
- name: '[COPY CERTS] - Make sure direcotry permissions to cert path is correct'
file:
dest: '/etc/letsencrypt/live/{{ item.domain }}'
owner: '{{ item.owner }}'
group: '{{ item.group }}'
recurse: 'yes'
when: letsencrypt_copy_certs == 'true'
loop: '{{ letsencrypt_copy_cert_from }}'