sophos.sophos_firewall.sfos_notification_target module – Manage Notification Settings (System > Administration > Notification)

Note

This module is part of the sophos.sophos_firewall collection (version 2.5.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sophos.sophos_firewall. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sophos.sophos_firewall.sfos_notification_target.

New in sophos.sophos_firewall 2.5.0

Synopsis

  • Manage notification settings for email notifications on Sophos Firewall

Requirements

The below requirements are needed on the host that executes this module.

  • sophosfirewall-python

  • Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.

Parameters

Parameter

Comments

authentication_required

boolean

Enable or disable authentication

Choices:

  • false

  • true

certificate

string

Certificate for secure connections

connection_security

string

Connection security type

Choices:

  • "None" ← (default)

  • "SSLTLS"

  • "STARTTLS"

ip_family

string

IP family for connections

Choices:

  • "IPv4" ← (default)

  • "IPv6"

mail_body

string

Mail content/body for notifications

mail_server

string

Mail server IP address or hostname

management_interface

string

Management interface for notifications

oauth2_provider

string

OAuth2 provider for authentication

Choices:

  • "Gmail"

  • "Microsoft365"

password

string

Password for mail server authentication

port

integer

Mail server port

Default: 25

recipient

string

Recipient email address

sender_address

string

Sender email address

state

string / required

Use query to retrieve or updated to modify

Choices:

  • "updated"

  • "query"

subject

string

Subject for mail notifications

username

string

Username for mail server authentication

Examples

- name: Update notification settings
  sophos.sophos_firewall.sfos_notification_target:
    mail_server: "smtp.example.com"
    port: 587
    authentication_required: true
    username: "notifications@example.com"
    password: "secure_password"
    sender_address: "firewall@example.com"
    recipient: "admin@example.com"
    connection_security: "STARTTLS"
    subject: "Firewall Notification"
    mail_body: "This is an automated notification from your firewall."
    ip_family: "IPv4"
    state: updated

- name: Query notification settings
  sophos.sophos_firewall.sfos_notification_target:
    state: query

- name: Configure OAuth2 Gmail notifications
  sophos.sophos_firewall.sfos_notification_target:
    mail_server: "smtp.gmail.com"
    port: 587
    authentication_required: true
    oauth2_provider: "Gmail"
    username: "notifications@example.com"
    password: "app_password"
    sender_address: "firewall@example.com"
    recipient: "admin@example.com"
    connection_security: "STARTTLS"
    state: updated

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

Serialized object containing the API response.

Returned: always

Authors

  • Matt Mullen (@mamullen13316)