community.network.onyx_username (0.2.1) — module

Configure username module

| "added in version" 0.2.0 of community.network"

Authors: Anas Shami (@anass)

Install collection

Install with ansible-galaxy collection install community.network:==0.2.1


Add to requirements.yml

  collections:
    - name: community.network
      version: 0.2.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