# SPDX-FileCopyrightText: 2020 - 2025 Slavi Pantaleev # SPDX-FileCopyrightText: 2020 Scott Crossen # # SPDX-License-Identifier: AGPL-3.0-or-later --- - name: Fail if no matrix-dynamic-dns configurations specified ansible.builtin.fail: msg: >- You need to define at least one configuration in `ddclient_domain_configurations` for using matrix-dynamic-dns. when: "ddclient_domain_configurations | length == 0" - name: Fail if required matrix-dynamic-dns settings not defined in configuration blocks ansible.builtin.fail: msg: >- One of the configurations in ddclient_domain_configurations is missing a required key (domain, protocol). when: "'domain' not in configuration or 'protocol' not in configuration" with_items: "{{ ddclient_domain_configurations }}" loop_control: loop_var: configuration - name: Fail if required matrix-dynamic-dns settings not defined ansible.builtin.fail: msg: >- You need to define a required configuration setting (`{{ item.name }}`). when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" with_items: - {'name': 'ddclient_container_network', when: true}