community.windows.win_snmp 模块 – 配置 Windows SNMP 服务
注意
此模块是 community.windows 集合(版本 2.3.0)的一部分。
如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.windows。
要在 playbook 中使用它,请指定:community.windows.win_snmp。
概要
- 此模块配置 Windows SNMP 服务。 
参数
| 参数 | 注释 | 
|---|---|
| 
 
 
 选项 
 | |
| 只读 SNMP 团体字符串的列表。 | |
| 允许的 SNMP 管理器的列表。 | 
示例
- name: Replace SNMP communities and managers
  community.windows.win_snmp:
    community_strings:
      - public
    permitted_managers:
      - 192.168.1.2
    action: set
- name: Replace SNMP communities and clear managers
  community.windows.win_snmp:
    community_strings:
      - public
    permitted_managers: []
    action: set
返回值
通用返回值记录在 此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 此机器的团体字符串列表。 返回: 总是 示例:  | |
| 此机器的允许管理器列表。 返回: 总是 示例:  | 
