- name: trap test
  hosts: ism
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "set snmp trap v2c"
    inspur.sm.edit_snmp_trap:
      version: "2c"
      event_severity: "warning"
      community: "test"
      system_name: "Inspur"
      provider: "{{ ism }}"

  - name: "set snmp trap v3"
    inspur.sm.edit_snmp_trap:
      version: "3"
      event_severity: "all"
      v3username: "Inspur"
      engine_id: "1234567890"
      auth_protocol: "SHA"
      auth_password: "12345678"
      priv_protocol: "AES"
      priv_password: "123454678"
      trap_port: 162
      provider: "{{ ism }}"