sophos.sophos_firewall.sfos_netflow module – Manage NetFlow configuration (System > Administration > NetFlow)

Note

This module is part of the sophos.sophos_firewall collection (version 2.1.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_netflow.

New in sophos.sophos_firewall 2.1.0

Synopsis

  • Manage Netflow Collectors (System > Administration > NetFlow) 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

netflow_server

string

IP address or hostname of the NetFlow collector.

Required for state=present and state=updated.

netflow_server_port

integer

UDP port number for the NetFlow collector.

Required for state=present and state=updated.

server_name

string

Unique identifier for the NetFlow server configuration.

Required for all states except query when fetching all servers.

state

string / required

present - Add a new NetFlow server configuration. Fails if server_name already exists.

updated - Modify an existing NetFlow server configuration. Fails if server_name does not exist.

absent - Remove a NetFlow server configuration.

query - Retrieve NetFlow server configuration(s).

Choices:

  • "present"

  • "updated"

  • "absent"

  • "query"

Examples

- name: Add a new NetFlow server configuration 'collector1'
  sophos.sophos_firewall.sfos_netflow:
    state: present
    server_name: "collector1"
    netflow_server: "192.168.1.100"
    netflow_server_port: 2055

- name: Update NetFlow server 'collector1' to a new port
  sophos.sophos_firewall.sfos_netflow:
    state: updated
    server_name: "collector1"
    netflow_server: "192.168.1.100" # Current or new IP
    netflow_server_port: 2056      # New port

- name: Query all NetFlow server configurations
  sophos.sophos_firewall.sfos_netflow:
    state: query
  register: all_netflow_configs

- name: Remove NetFlow server 'collector1'
  sophos.sophos_firewall.sfos_netflow:
    state: absent
    server_name: "collector1"

Return Values

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

Key

Description

api_response

dictionary

The full API response from the Sophos Firewall for the last operation.

Returned: always

changed

boolean

Whether or not the resource was changed.

Returned: always

netflow_servers

list / elements=dictionary

A list of configured NetFlow servers. Returned when state is ‘query’.

Returned: on query

Sample: [{"NetflowServer": "192.168.1.100", "NetflowServerPort": "2055", "ServerName": "collector1"}]

Authors

  • Matt Mullen (@mamullen13316)