-
Notifications
You must be signed in to change notification settings - Fork 312
allow email-notifications on the bastion host #328
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
base: devel
Are you sure you want to change the base?
Conversation
| include: set_facts_.yaml | ||
| # ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks. | ||
| # CentOS Stream 8 | ||
| import_tasks: set_facts_.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets stick with include_tasks, as you have used it below as well (or whichever is more convenient, but lets keep everything in sync)
| msg: | ||
| - "Please run /usr/local/bin/helpernodecheck for information" | ||
|
|
||
| - "Please run /usr/local/bin/helpernodecheck for information" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - "Please run /usr/local/bin/helpernodecheck for information" | |
| - "Please run /usr/local/bin/helpernodecheck for information" | |
|
|
||
| - name: Check postfix | ||
| command: postfix check | ||
| when: postfix_check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| when: postfix_check | |
| when: postfix_check | |
|
|
||
| - set_fact: | ||
| postfix_smtp_services: | ||
| - smtp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - smtp | |
| - smtp | |
| sender: "openshift@{{ helper.name }}.{{ dns.clusterid }}.{{ dns.domain | lower }}" | ||
| to: "incoming@{{ helper.name }}.{{ dns.clusterid }}.{{ dns.domain | lower }}" | ||
| subject: Email By Ansible | ||
| body: Test successful No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| body: Test successful | |
| body: Test successful | |
This PR adds the email feature on the bastion host so that users can test Prometheus rules and Alertmanager notifications out of the box.
Given that the
ocp4-helpernodeproject already provides DNSMX Recordit was a no-brainer to include this as part of this helpful project.Please note that the code utilized was mostly obtained from the upstream postfix ansible-galaxy role [1]. However, found it too convoluted to use alone in addition to the ocp4-helpernode project. It is my opinion that this addition to the ocp4-helpernode will greatly help me and others to facilitate the setup to a more realistic test environment.
The details are as follow:
127.0.0.1& theopenshift4subnet192.168.7.0/24openshift&incomingwhich Alertmanager uses to connect and receive the email notifications - (required)./usr/sbin/nologinshell and locked password.postfix_filesorpostfix_confper the upstream project [1] if you desire.docs/email-notifications.mdfor how to get this up and working with minimal effort. So you can focus on testing and not having to figure out how to implement email on the bastion host.Tested on
RHEL-8.10andCentos Stream 8[1] - https://github.com/linux-system-roles/postfix