Skip to content

Commit

Permalink
added e-mail capability
Browse files Browse the repository at this point in the history
  • Loading branch information
adworjan committed Aug 16, 2024
1 parent 9543b1f commit 975f8ea
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .ansible-sign/sha256sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ a3dc6c14a17f1d5b86f466016d23278f80b334c28b84a73d1671255af0cd57ac roles/servicen
96fe8ffc8373291cdd82d3213a08eb1f73b4f09364b96db538941787a845a7ab roles/servicenow_change_request/tasks/servicenow_create.yml
f24230fbcf3e3e8ead1a35ca1bc06ee6279cdd60180129a1d78e90dced09ce8f roles/servicenow_change_request/tasks/servicenow_deleted.yml
3841652179642981ddbf9d8ec47f2f8197702fb65e2fd4aab5714669c2ffcd52 roles/servicenow_change_request/tasks/servicenow_implement.yml
54d42c1164e83348a688c781e22f08c9483bccee6f89804087031e0bcd90ab5d roles/servicenow_change_request_schedule/tasks/main.yml
098aebd21cd9813675b45a5c20ff558610d5ffb87c9529e6a9a895e7e3a26b10 roles/servicenow_change_request_schedule/defaults/main.yml
280b2cbbc8c8b8f5e685cfd442f507f9307513b2dd7efe62d6c2eee92064db0b roles/servicenow_change_request_schedule/tasks/main.yml
a464004cbb41d95d683f7a25ae37a1813d17be673a1b2a834186ac123bd961fb roles/servicenow_change_request_wait/defaults/main.yml
5c15d56df4f343e4cee23d1f94953b6ff9f524ada30033d0c488835bbdcea6eb roles/servicenow_change_request_wait/tasks/main.yml
de2faeda622d9985f01ed5df7b6af5367c9cd9549f07482331906bb9c444a022 roles/servicenow_cmdb/tasks/main.yml
Expand Down
22 changes: 11 additions & 11 deletions .ansible-sign/sha256sum.txt.sig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAma/glwACgkQTiIiIXrU
DNGDNgwAucHJoFBBZgPLy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3YzyD6X6V2YL9h4TqWWjzLD9t8sprkZvyNc9
Jvd6KPkk
=EDDM
-----END PGP SIGNATURE-----
2 changes: 2 additions & 0 deletions roles/servicenow_change_request_schedule/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
to_email: "{{ to_emails.split(',') }}"

Check warning on line 2 in roles/servicenow_change_request_schedule/defaults/main.yml

View workflow job for this annotation

GitHub Actions / build

var-naming[no-role-prefix]

Variables names from within roles should use servicenow_change_request_schedule_ as a prefix. (vars: to_email)
12 changes: 12 additions & 0 deletions roles/servicenow_change_request_schedule/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
state: assess
register: request

- name: Send Approval e-mail
community.general.mail:
host: "{{ EMAIL_HOST }}"
username: "{{ EMAIL_USERNAME }}"
password: "{{ EMAIL_PASSWORD }}"
port: "{{ EMAIL_PORT }}"
subject: Approval request for ServiceNow Change Request {{ request.record.number }}
body: "You have a new CR Approval request. Please click on this URL to approve: {{ lookup('env', 'SN_HOST') }}nav_to.do?uri=change_request.do?sysparm_query=number={{

Check warning on line 24 in roles/servicenow_change_request_schedule/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[line-length]

Line too long (169 > 160 characters)
request.record.number }}"
from: tower@shadowman.dev
to: "{{ to_email }}"

- name: Pass along request information
ansible.builtin.set_stats:
data:
Expand Down

0 comments on commit 975f8ea

Please sign in to comment.