Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuning notification playbooks to allow for single user notification #654

Merged
merged 4 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions playbooks/notifications/email-notify-single-user.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
---

- include_vars:
file: "{{ email_content_file }}"
when:
- email_content_file is defined
- set_fact:
markdown_content: "{{ body }}"
- include_role:
name: notifications/md-to-html
- set_fact:
mail: "{{ mail | combine( {'subject': title, 'body': md_to_html.html_body_message, 'to': email_to} ) }}"
- include_role:
name: notifications/send-email
- name: "Send HTML e-mail message to a single user"
hosts: mail-host
gather_facts: no
tasks:
- include_tasks: email-notify-tasks.yml

15 changes: 15 additions & 0 deletions playbooks/notifications/email-notify-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

- include_vars:
file: "{{ email_content_file }}"
when:
- email_content_file is defined
- set_fact:
markdown_content: "{{ body }}"
- include_role:
name: notifications/md-to-html
- set_fact:
mail: "{{ mail | combine( {'subject': title, 'body': md_to_html.html_body_message, 'to': email_to} ) }}"
- include_role:
name: notifications/send-email

2 changes: 1 addition & 1 deletion playbooks/notifications/email-notify-users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
hosts: mail-host
gather_facts: no
tasks:
- include_tasks: email-notify-single-user.yml
- include_tasks: email-notify-tasks.yml
vars:
first_name: "{{ item.first_name }}"
user_name: "{{ item.user_name }}"
Expand Down