chrisvanmeer.tty_sessions
ansible-role-tty-sessions
A role for checking active TTY sessions on Linux hosts.
Requirements
You need jmespath
installed.
Role Variables
tty_session_email_enabled: false
Email notifications are off by default. Change this to true
to turn them on.
tty_session_email_subject: "Open TTY sessions"
This is the subject line for email reports.
tty_session_email_subtype: "html"
This sets the email type to html
. You can also use plain
. You can customize the email template as needed.
There are more email-related variables you can use. Check the last task in the playbook for details. If these are not set, they will be ignored, but you can include them as variables instead of changing the playbook directly.
Dependencies
For email functionality, this role needs the community.general.mail
module.
Example Playbook
Here's an example of how to use this role with variables:
- name: Monitor TTY sessions
hosts: all
become: true
vars:
tty_session_email_enabled: true
tty_session_email_subject: "Open TTY sessions"
tty_session_email_sender: "[email protected]"
tty_session_email_recipient: "[email protected]"
tty_session_smtp_server: "smtp.yourdomain.com"
tty_session_smtp_port: 25
roles:
- role: chrisvanmeer.tty_sessions
License
BSD License
Author Information
- Chris van Meer c.v.meer@atcomputing.nl
Installa
ansible-galaxy install chrisvanmeer.tty_sessions
Licenza
Unknown
Download
1.2k
Proprietario