mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Renamed server roles by osi they work on
This commit is contained in:
30
roles/srv-web-6-6-tls-core/tasks/flavors/dedicated.yml
Normal file
30
roles/srv-web-6-6-tls-core/tasks/flavors/dedicated.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
- name: "Check if certificate already exists for {{ domain }}"
|
||||
cert_check_exists:
|
||||
domain: "{{ domain }}"
|
||||
cert_base_path: "{{ certbot_cert_path }}"
|
||||
register: cert_check
|
||||
|
||||
- name: "receive certificate for {{ domain }}"
|
||||
command: >-
|
||||
certbot certonly
|
||||
--agree-tos
|
||||
--email {{ users.administrator.email }}
|
||||
--non-interactive
|
||||
{% if certbot_acme_challenge_method != "webroot" %}
|
||||
--dns-{{ certbot_acme_challenge_method }}
|
||||
--dns-{{ certbot_acme_challenge_method }}-credentials {{ certbot_credentials_file }}
|
||||
--dns-{{ certbot_acme_challenge_method }}-propagation-seconds {{ certbot_dns_propagation_wait_seconds }}
|
||||
{% else %}
|
||||
--webroot
|
||||
-w {{ certbot_webroot_path }}
|
||||
{% endif %}
|
||||
{% if wildcard_domain is defined and ( wildcard_domain | bool ) %}
|
||||
-d {{ primary_domain }}
|
||||
-d *.{{ primary_domain }}
|
||||
{% else %}
|
||||
-d {{ domain }}
|
||||
{% endif %}
|
||||
{{ '--test-cert' if mode_test | bool else '' }}
|
||||
register: certbot_result
|
||||
changed_when: "'Certificate not yet due for renewal' not in certbot_result.stdout"
|
||||
when: not cert_check.exists
|
Reference in New Issue
Block a user