sophos.sophos_firewall.sfos_snmp_user module – Manage SNMPv3 User (System > Administration > SNMP)

Note

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

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_snmp_user.

New in sophos.sophos_firewall 1.1.0

Synopsis

  • Manage SNMP User (System > Administration > SNMP) 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

accept_queries

string

Enable or Disable querying

Choices:

  • "Enable"

  • "Disable"

authentication_algorithm

string

Authentication algorithm

Choices:

  • "MD5"

  • "SHA256"

  • "SHA512"

authentication_password

string

Authentication password

authorized_hosts

list / elements=string

List of authorized hosts

encryption_algorithm

string

Encryption algorithm

Choices:

  • "AES"

  • "DES"

  • "None"

encryption_password

string

Encryption password

name

string

SNMPv3 Username

send_traps

string

Enable or Disable sending of SNMP traps

Choices:

  • "Enable"

  • "Disable"

state

string / required

Use query to retrieve or updated to modify

Choices:

  • "updated"

  • "query"

Examples

- name: Add SNMPv3 User
  sophos.sophos_firewall.sfos_snmp_user:
    enabled: true
    name: snmpv3user
    send_queries: Enable
    send_traps: Disable
    authorized_hosts:
        - 10.100.1.104
        - 10.100.1.105
    encryption_algorithm: AES
    encryption_password: "{{ encryption_password }}"
    authentication_algorithm: MD5
    authentication_password: "{{ authentication_password }}"
    state: present

- name: Query SNMPv3 User
  sophos.sophos_firewall.sfos_snmp_user:
    username: "{{ username }}"
    password: "{{ password }}"
    hostname: "{{ inventory_hostname }}"
    port: 4444
    verify: false
    name: snmpv3user
    state: query

- name: Update SNMPv3 User
  sophos.sophos_firewall.sfos_snmp_user:
    enabled: true
    name: snmpv3user
    send_queries: Disable
    encryption_algorithm: AES
    encryption_password: "{{ encryption_password }}"
    authentication_password: "{{ authentication_password }}"
    state: present

- name: Remove SNMPv3 User
  sophos.sophos_firewall.sfos_snmp_user:
    enabled: true
    name: snmpv3user
    state: absent

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)