File: //lib/python3.9/site-packages/ansible_collections/cyberark/pas/rulebooks/pta_notify.yml
---
- hosts: all
connection: local
collections:
- cyberark.pas
tasks:
- name: Sending an e-mail using Gmail SMTP servers
community.general.mail:
host: SMTPSERVER
port: PORT
username: [email protected]
password: password
to: First Last <[email protected]>
subject: Ansible-Rulebook Report
body: Ansible Rulebook notify of PTA Event '{{ username | ansible.builtin.regex_search('^[a-zA-Z0-9_]+') }}' '{{ eventname }}' from host '{{ station }}' For more info please visit - '{{ eventurl }}'
delegate_to: localhost