Fix some ansible-lint-reported warnings

This mostly fixes `key-order` warnings around
`block` statements.
This commit is contained in:
Slavi Pantaleev
2022-09-27 11:38:33 +03:00
parent 0ab5371ebd
commit 1ea1597020
64 changed files with 217 additions and 223 deletions

View File

@ -16,7 +16,8 @@
# Tasks related to setting up Let's Encrypt's management of certificates
#
- block:
- when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
block:
- name: Ensure certbot Docker image is pulled
docker_image:
name: "{{ matrix_ssl_lets_encrypt_certbot_docker_image }}"
@ -43,13 +44,13 @@
mode: 0644
when: "item.applicable | bool"
with_items: "{{ matrix_ssl_renewal_systemd_units_list }}"
when: "matrix_ssl_retrieval_method == 'lets-encrypt'"
#
# Tasks related to getting rid of Let's Encrypt's management of certificates
#
- block:
- when: "matrix_ssl_retrieval_method != 'lets-encrypt'"
block:
- name: Ensure matrix-ssl-lets-encrypt-renew cronjob removed
ansible.builtin.file:
path: "{{ matrix_systemd_path }}/{{ item.name }}"
@ -61,4 +62,3 @@
ansible.builtin.file:
path: "{{ matrix_local_bin_path }}/matrix-ssl-lets-encrypt-certificates-renew"
state: absent
when: "matrix_ssl_retrieval_method != 'lets-encrypt'"

View File

@ -13,7 +13,8 @@
- ansible.builtin.set_fact:
domain_name_needs_cert: "{{ not domain_name_certificate_path_stat.stat.exists }}"
- block:
- when: "domain_name_needs_cert | bool and matrix_ssl_pre_obtaining_required_service_name != ''"
block:
- name: Ensure required service for obtaining is started
ansible.builtin.service:
name: "{{ matrix_ssl_pre_obtaining_required_service_name }}"
@ -24,7 +25,6 @@
ansible.builtin.wait_for:
timeout: "{{ matrix_ssl_pre_obtaining_required_service_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.