community.general.onyx_username (0.1.1) — module

Configure username module

Authors: Anas Shami (@anass)

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 users/roles on Mellanox ONYX network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create new user
  onyx_username:
      username: anass
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: set the user full-name
  onyx_username:
      username: anass
      full_name: anasshami
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: set the user encrypted password
  onyx_username:
      username: anass
      password: 12345
      encrypted_password: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: set the user capability
  onyx_username:
      username: anass
      capability: monitor
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: reset the user capability
  onyx_username:
      username: anass
      reset_capability: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove the user configuration
  onyx_username:
      username: anass
      state: absent

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - Set state of the given account
    type: str

disabled:
    choices:
    - none
    - login
    - password
    - all
    description:
    - Disable means of logging into this account
    type: str

password:
    description:
    - Set password fot such user
    type: str

username:
    description:
    - Create/Edit user using username
    required: true
    type: str

full_name:
    description:
    - Set the full name of this user
    type: str

capability:
    choices:
    - monitor
    - unpriv
    - v_admin
    - admin
    description:
    - Grant capability to this user account
    type: str

nopassword:
    default: false
    description:
    - Clear password for such user
    type: bool

disconnected:
    default: false
    description:
    - Disconnect all sessions of this user
    type: bool

reset_capability:
    default: false
    description:
    - Reset capability to this user account
    type: bool

encrypted_password:
    default: false
    description:
    - Decide the type of setted password (plain text or encrypted)
    type: bool

Outputs

commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  sample:
  - username *
  - username * password *
  - username * nopassword
  - username * disable login
  - username * capability admin
  - no username *
  - no username * disable
  type: list