community.general.ce_snmp_user (0.1.1) — module

Manages SNMP user configuration on HUAWEI CloudEngine switches.

Authors: wangdezhuang (@QijunPan)

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

Manages SNMP user configurations on CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: CloudEngine snmp user test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Config SNMP usm user"
    ce_snmp_user:
      state: present
      usm_user_name: wdz_snmp
      remote_engine_id: 800007DB03389222111200
      acl_number: 2000
      user_group: wdz_group
      provider: "{{ cli }}"

  - name: "Undo SNMP usm user"
    ce_snmp_user:
      state: absent
      usm_user_name: wdz_snmp
      remote_engine_id: 800007DB03389222111200
      acl_number: 2000
      user_group: wdz_group
      provider: "{{ cli }}"

  - name: "Config SNMP local user"
    ce_snmp_user:
      state: present
      aaa_local_user: wdz_user
      auth_protocol: md5
      auth_key: huawei123
      priv_protocol: des56
      priv_key: huawei123
      provider: "{{ cli }}"

  - name: "Config SNMP local user"
    ce_snmp_user:
      state: absent
      aaa_local_user: wdz_user
      auth_protocol: md5
      auth_key: huawei123
      priv_protocol: des56
      priv_key: huawei123
      provider: "{{ cli }}"

Inputs

    
auth_key:
    description:
    - The authentication password. Password length, 8-255 characters.

priv_key:
    description:
    - The encryption password. Password length 8-255 characters.

acl_number:
    description:
    - Access control list number.

user_group:
    description:
    - Name of the group where user belongs to.

auth_protocol:
    choices:
    - noAuth
    - md5
    - sha
    description:
    - Authentication protocol.

priv_protocol:
    choices:
    - noPriv
    - des56
    - 3des168
    - aes128
    - aes192
    - aes256
    description:
    - Encryption protocol.

usm_user_name:
    description:
    - Unique name to identify the USM user.

aaa_local_user:
    description:
    - Unique name to identify the local user.

remote_engine_id:
    description:
    - Remote engine id of the USM user.

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of aaa params after module execution
  returned: always
  sample:
    snmp local user:
      local_user_info: []
    snmp usm user:
      usm_user_info:
      - aclNumber: '2000'
        engineID: 800007DB03389222111200
        groupName: wdz_group
        userName: wdz_snmp
  type: dict
existing:
  description: k/v pairs of existing aaa server
  returned: always
  sample:
    snmp local user:
      local_user_info: []
    snmp usm user:
      usm_user_info: []
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    acl_number: '2000'
    remote_engine_id: 800007DB03389222111200
    state: present
    user_group: wdz_group
    usm_user_name: wdz_snmp
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - snmp-agent remote-engineid 800007DB03389222111200 usm-user v3 wdz_snmp wdz_group
    acl 2000
  type: list