|
|
|
@@ -12,17 +12,18 @@ |
|
|
|
- set_fact: |
|
|
|
domain_name_needs_cert: "{{ not domain_name_certificate_path_stat.stat.exists }}" |
|
|
|
|
|
|
|
- name: Ensure dynamic dns has ran |
|
|
|
service: |
|
|
|
name: "dynamic-dns" |
|
|
|
state: started |
|
|
|
register: dynamic_dns_service_update |
|
|
|
when: "domain_name_needs_cert|bool and matrix_dynamic_dns_enabled|bool" |
|
|
|
- block: |
|
|
|
- name: Ensure required service for obtaining is started |
|
|
|
service: |
|
|
|
name: "{{ matrix_ssl_pre_obtaining_required_service_name }}" |
|
|
|
state: started |
|
|
|
register: matrix_ssl_pre_obtaining_required_service_start_result |
|
|
|
|
|
|
|
- name: Sleep for 60 seconds so that DNS records can be updated |
|
|
|
wait_for: |
|
|
|
timeout: 60 |
|
|
|
when: dynamic_dns_service_update.changed |
|
|
|
- name: Wait some time, so that the required service for obtaining can start |
|
|
|
wait_for: |
|
|
|
timeout: "{{ matrix_ssl_service_to_start_before_obtaining_start_wait_time_seconds }}" |
|
|
|
when: "matrix_ssl_pre_obtaining_required_service_start_result.changed|bool" |
|
|
|
when: "domain_name_needs_cert|bool and matrix_ssl_pre_obtaining_required_service_name != ''" |
|
|
|
|
|
|
|
# This will fail if there is something running on port 80 (like matrix-nginx-proxy). |
|
|
|
# We suppress the error, as we'll try another method below. |
|
|
|
|