Git initial commit
This commit is contained in:
commit
4cd677e01c
12 files changed
+521
No files matched your search
Executable
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
- name: install python3 certbot and recommendations
|
||||
apt:
|
||||
update_cache: yes
|
||||
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
|
||||
install_recommends: yes
|
||||
pkg:
|
||||
- python3-certbot
|
||||
- python3-certbot-nginx
|
||||
register: certbot_nginx_installation
|
||||
|
||||
- name: create letsencrypt account
|
||||
command:
|
||||
cmd: |
|
||||
certbot register
|
||||
-m {{ letsencrypt_mail_address }}
|
||||
--agree-tos
|
||||
--noninteractive
|
||||
--redirect
|
||||
when: certbot_nginx_installation.changed
|
||||
|
||||
- name: Setup renewal scripts
|
||||
copy:
|
||||
dest: "/etc/letsencrypt/renewal-hooks/{{ item.type }}/{{ item.name }}.sh"
|
||||
mode: 0700
|
||||
content: "{{ item.content }}"
|
||||
loop: "{{ letsencrypt_renewal_scripts }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
|
||||
- name: create let's-encrypt certificates for web web_sites
|
||||
command:
|
||||
cmd: |
|
||||
certbot
|
||||
--nginx
|
||||
-d {% if cert_domain is not string and cert_domain is iterable %}{{ cert_domain | join(',') }}{% else %}{{ cert_domain }}{% endif %}
|
||||
-m {{ letsencrypt_mail_address }}
|
||||
--agree-tos
|
||||
--noninteractive
|
||||
--redirect
|
||||
creates: "/etc/letsencrypt/live/{% if cert_domain is not string and cert_domain is iterable %}{{ cert_domain[0] }}{% else %}{{ cert_domain }}{% endif %}"
|
||||
loop: "{{ web_sites | json_query('[?letsencrypt==`true`&&state==`present`].domain') }}"
|
||||
loop_control:
|
||||
loop_var: cert_domain
|
||||
label: "{% if cert_domain is not string and cert_domain is iterable %}{{ cert_domain | join(',') }}{% else %}{{ cert_domain }}{% endif %}"
|
||||
|
||||
- name: Setup cronjob for auto renewal
|
||||
cron:
|
||||
name: letsencrypt
|
||||
special_time: daily
|
||||
job: /usr/bin/certbot -q renew
|
||||
|
||||
Reference in new issue
Block a user