| 1 |
.. _ome_application_alerts_smtp_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_application_alerts_smtp -- This module allows to configure SMTP or email configurations |
| 5 |
=========================================================================================== |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module allows to configure SMTP or email configurations on OpenManage Enterprise and OpenManage Enterprise Modular. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- python \>= 3.9.6 |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
Parameters |
| 28 |
---------- |
| 29 |
|
| 30 |
destination_address (True, str, None) |
| 31 |
The IP address or FQDN of the SMTP destination server. |
| 32 |
|
| 33 |
|
| 34 |
port_number (optional, int, None) |
| 35 |
The port number of the SMTP destination server. |
| 36 |
|
| 37 |
|
| 38 |
use_ssl (optional, bool, None) |
| 39 |
Use SSL to connect with the SMTP server. |
| 40 |
|
| 41 |
|
| 42 |
enable_authentication (True, bool, None) |
| 43 |
Enable or disable authentication to access the SMTP server. |
| 44 |
|
| 45 |
The \ :emphasis:`credentials`\ are mandatory if \ :emphasis:`enable\_authentication`\ is \ :literal:`true`\ . |
| 46 |
|
| 47 |
The module will always report change when this is \ :literal:`true`\ . |
| 48 |
|
| 49 |
|
| 50 |
credentials (optional, dict, None) |
| 51 |
The credentials for the SMTP server |
| 52 |
|
| 53 |
|
| 54 |
username (True, str, None) |
| 55 |
The username to access the SMTP server. |
| 56 |
|
| 57 |
|
| 58 |
password (True, str, None) |
| 59 |
The password to access the SMTP server. |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
hostname (True, str, None) |
| 64 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 65 |
|
| 66 |
|
| 67 |
username (False, str, None) |
| 68 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 69 |
|
| 70 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 71 |
|
| 72 |
Example: export OME\_USERNAME=username |
| 73 |
|
| 74 |
|
| 75 |
password (False, str, None) |
| 76 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 77 |
|
| 78 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 79 |
|
| 80 |
Example: export OME\_PASSWORD=password |
| 81 |
|
| 82 |
|
| 83 |
x_auth_token (False, str, None) |
| 84 |
Authentication token. |
| 85 |
|
| 86 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 87 |
|
| 88 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 89 |
|
| 90 |
|
| 91 |
port (optional, int, 443) |
| 92 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 93 |
|
| 94 |
|
| 95 |
validate_certs (optional, bool, True) |
| 96 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 97 |
|
| 98 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 99 |
|
| 100 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 101 |
|
| 102 |
|
| 103 |
ca_path (optional, path, None) |
| 104 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 105 |
|
| 106 |
|
| 107 |
timeout (optional, int, 30) |
| 108 |
The socket level timeout in seconds. |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
Notes |
| 115 |
----- |
| 116 |
|
| 117 |
.. note:: |
| 118 |
- The module will always report change when \ :emphasis:`enable\_authentication`\ is \ :literal:`true`\ . |
| 119 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise or OpenManage Enterprise Modular. |
| 120 |
- This module support \ :literal:`check\_mode`\ . |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
Examples |
| 126 |
-------- |
| 127 |
|
| 128 |
.. code-block:: yaml+jinja |
| 129 |
|
| 130 |
|
| 131 |
--- |
| 132 |
- name: Update SMTP destination server configuration with authentication |
| 133 |
dellemc.openmanage.ome_application_alerts_smtp: |
| 134 |
hostname: "192.168.0.1" |
| 135 |
username: "user_name" |
| 136 |
password: "user_password" |
| 137 |
ca_path: "/path/to/ca_cert.pem" |
| 138 |
destination_address: "localhost" |
| 139 |
port_number: 25 |
| 140 |
use_ssl: true |
| 141 |
enable_authentication: true |
| 142 |
credentials: |
| 143 |
username: "username" |
| 144 |
password: "password" |
| 145 |
- name: Update SMTP destination server configuration without authentication |
| 146 |
dellemc.openmanage.ome_application_alerts_smtp: |
| 147 |
hostname: "192.168.0.1" |
| 148 |
username: "user_name" |
| 149 |
password: "user_password" |
| 150 |
ca_path: "/path/to/ca_cert.pem" |
| 151 |
destination_address: "localhost" |
| 152 |
port_number: 25 |
| 153 |
use_ssl: false |
| 154 |
enable_authentication: false |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
Return Values |
| 159 |
------------- |
| 160 |
|
| 161 |
msg (always, str, Successfully updated the SMTP settings.) |
| 162 |
Overall status of the SMTP settings update. |
| 163 |
|
| 164 |
|
| 165 |
smtp_details (success, dict, {'DestinationAddress': 'localhost', 'PortNumber': 25, 'UseCredentials': True, 'UseSSL': False, 'Credential': {'User': 'admin', 'Password': None}}) |
| 166 |
returned when SMTP settings are updated successfully. |
| 167 |
|
| 168 |
|
| 169 |
error_info (on HTTP error, dict, {'error': {'code': 'Base.1.0.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.', '@Message.ExtendedInfo': [{'MessageId': 'CAPP1106', 'RelatedProperties': [], 'Message': 'Unable to update the SMTP settings because the entered credential is invalid or empty.', 'MessageArgs': [], 'Severity': 'Critical', 'Resolution': 'Either enter valid credentials or disable the Use Credentials option and retry the operation.'}]}}) |
| 170 |
Details of the HTTP Error. |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
Status |
| 177 |
------ |
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
Authors |
| 184 |
~~~~~~~ |
| 185 |
|
| 186 |
- Sachin Apagundi(@sachin-apa) |
| 187 |
- Bhavneet Sharma (@Bhavneet-Sharma) |
| 188 |
|