ansible.builtin.win_snmp (v2.9.27) — module

Configures the Windows SNMP service

| "added in version" 2.8 of ansible.builtin"

Authors: Michael Cassaniti (@mcassaniti)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

This module configures the Windows SNMP service.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
  - hosts: Windows
    tasks:
      - name: Replace SNMP communities and managers
        win_snmp:
          community_strings:
            - public
          permitted_managers:
            - 192.168.1.2
          action: set
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - hosts: Windows
    tasks:
      - name: Replace SNMP communities and clear managers
        win_snmp:
          community_strings:
            - public
          permitted_managers: []
          action: set

Inputs

    
action:
    choices:
    - add
    - set
    - remove
    default: set
    description:
    - C(add) will add new SNMP community strings and/or SNMP managers
    - C(set) will replace SNMP community strings and/or SNMP managers. An empty list for
      either C(community_strings) or C(permitted_managers) will result in the respective
      lists being removed entirely.
    - C(remove) will remove SNMP community strings and/or SNMP managers
    type: str

community_strings:
    description:
    - The list of read-only SNMP community strings.
    type: list

permitted_managers:
    description:
    - The list of permitted SNMP managers.
    type: list

Outputs

community_strings:
  description: The list of community strings for this machine.
  returned: always
  sample:
  - public
  - snmp-ro
  type: list
permitted_managers:
  description: The list of permitted managers for this machine.
  returned: always
  sample:
  - 192.168.1.1
  - 192.168.1.2
  type: list