W3cubDocs

/Ansible 2.10

mellanox.onyx.onyx_snmp_hosts – Configures SNMP host parameters

Note

This plugin is part of the mellanox.onyx collection.

To install it use: ansible-galaxy collection install mellanox.onyx.

To use it in a playbook, specify: mellanox.onyx.onyx_snmp_hosts.

New in version 0.2.0: of mellanox.onyx

Synopsis

  • This module provides declarative management of SNMP hosts protocol params on Mellanox ONYX network devices.

Parameters

Parameter Choices/Defaults Comments
hosts
list / elements=string
List of snmp hosts
auth_password
string
The password needed to configure the auth type.
auth_type
string
    Choices:
  • md5
  • sha
  • sha224
  • sha256
  • sha384
  • sha512
Configures SNMP v3 security parameters, specifying passwords in a nother parameter (auth_password) (passwords are always stored encrypted).
enabled
boolean
    Choices:
  • no
  • yes
Temporarily Enables/Disables sending of all notifications to this host.
name
string / required
Specifies the name of the host.
notification_type
string
    Choices:
  • trap
  • inform
Configures the type of sending notification to the specified host.
port
string
Overrides default target port for this host.
privacy_password
string
The password needed to configure the privacy type.
privacy_type
string
    Choices:
  • 3des
  • aes-128
  • aes-192
  • aes-192-cfb
  • aes-256
  • aes-256-cfb
  • des
Specifys SNMP v3 privacy settings for this user.
state
string
    Choices:
  • present
  • absent
Used to decide if you want to delete the specified host or not.
user_name
string
Specifys username for this inform sink.
version
string
    Choices:
  • 1
  • 2c
  • 3
Specifys SNMP version of informs to send.

Examples

- name: Enables snmp host
  onyx_snmp_hosts:
      hosts:
       - name: 1.1.1.1
         enabled: true

- name: Configures snmp host with version 2c
  onyx_snmp_hosts:
      hosts:
         - name: 2.3.2.4
           enabled: true
           notification_type: trap
           port: 66
           version: 2c

- name: Configures snmp host with version 3 and configures it with user as sara
  onyx_snmp_hosts:
       hosts:
         - name: 2.3.2.4
           enabled: true
           notification_type: trap
           port: 66
           version: 3
           user_name: sara
           auth_type: sha
           auth_password: jnbdfijbdsf
           privacy_type: 3des
           privacy_password: nojfd8uherwiugfh

- name: Deletes the snmp host
  onyx_snmp_hosts:
        hosts:
          - name: 2.3.2.4
            state: absent

Return Values

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

Key Returned Description
commands
list / elements=string
always
The list of configuration mode commands to send to the device.

Sample:
['snmp-server host <host_name> disable', 'no snmp-server host <host_name> disable', 'snmp-server host <host_name> informs port <port_number> version <version_number>', 'snmp-server host <host_name> traps port <port_number> version <version_number>', 'snmp-server host <host_name> informs port <port_number> version <version_number> user <user_name> auth <auth_type> <auth_password> priv <privacy_type> <privacy_password>', 'snmp-server host <host_name> traps port <port_number> version <version_number> user <user_name> auth <auth_type> <auth_password> priv <privacy_type> <privacy_password>', 'no snmp-server host <host_name>.']


Authors

  • Sara Touqan (@sarato)

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/mellanox/onyx/onyx_snmp_hosts_module.html