1
0
Fork 0
forked from infra/ansible

communishift: Update email notification with summary

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2026-05-01 10:42:51 +01:00
commit b1fca1e089
Signed by untrusted user: dkirwan
GPG key ID: A5893AB6474AC37D

View file

@ -31,3 +31,21 @@
tags:
- communishift_send_notifications
loop: "{{ lookup('dict', communishift_projects) }}"
- name: Summary of Communishift projects notified # noqa: run-once[task]
ansible.builtin.debug:
msg: |
{% set ns = namespace(names=[]) %}
{% for item in communishift_projects | dict2items | sort(attribute='value.name') %}
{% if not (item.value.do_not_delete | default(false)) %}
{% set _ = ns.names.append(item.value.name) %}
{% endif %}
{% endfor %}
Communishift notification run complete. Emails were sent for {{ ns.names | length }} project(s):
{% for name in ns.names %}
- {{ name }}
{% endfor %}
run_once: true
tags:
- communishift_send_notifications