--- - name: Assert gatus_endpoint parameters are sane ansible.builtin.assert: that: - gatus_endpoint_name | length > 0 - gatus_endpoint_pulled | length > 0 or gatus_endpoint_external | length > 0 fail_msg: >- gatus_endpoint needs a name and at least one of gatus_endpoint_pulled or gatus_endpoint_external. An empty file would contribute nothing, and a config with no endpoints at all makes Gatus refuse to start. - name: "Write Gatus endpoints '{{ gatus_endpoint_name }}'" ansible.builtin.template: src: endpoints.yaml.j2 dest: "{{ gatus_endpoints_dir }}/{{ gatus_endpoint_name }}.yaml" owner: root group: "{{ gatus_gid }}" mode: "0640" # No handler. Gatus polls its own config every 30s # (main.listenToConfigurationFileChanges) and reloads itself, so writing the # file IS the deploy. A handler here would also fail whenever this role is # used without roles/gatus loaded.