forked from infra/ansible
communishift: Update email notification with summary
Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
parent
4a51089c2e
commit
b1fca1e089
1 changed files with 18 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue