community.general.onyx_snmp_hosts (0.1.1) — module

Configures SNMP host parameters

Authors: Sara Touqan (@sarato)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: enables snmp host
  onyx_snmp_hosts:
      hosts:
       - name: 1.1.1.1
         enabled: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: deletes the snmp host
  onyx_snmp_hosts:
        hosts:
          - name: 2.3.2.4
            state: absent

Inputs

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

Outputs

commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  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>.
  type: list