mellanox.onyx.onyx_username – Configure username module

Note

This plugin is part of the mellanox.onyx collection (version 1.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install mellanox.onyx.

To use it in a playbook, specify: mellanox.onyx.onyx_username.

New in version 0.2.0: of mellanox.onyx

Synopsis

  • This module provides declarative management of users/roles on Mellanox ONYX network devices.

Parameters

Parameter Choices/Defaults Comments
capability
string
    Choices:
  • monitor
  • unpriv
  • v_admin
  • admin
Grant capability to this user account
disabled
string
    Choices:
  • none
  • login
  • password
  • all
Disable means of logging into this account
disconnected
boolean
    Choices:
  • no
  • yes
Disconnect all sessions of this user
encrypted_password
boolean
    Choices:
  • no
  • yes
Decide the type of setted password (plain text or encrypted)
full_name
string
Set the full name of this user
nopassword
boolean
    Choices:
  • no
  • yes
Clear password for such user
password
string
Set password fot such user
reset_capability
boolean
    Choices:
  • no
  • yes
Reset capability to this user account
state
string
    Choices:
  • present
  • absent
Set state of the given account
username
string / required
Create/Edit user using username

Examples

- name: Create new user
  onyx_username:
      username: anass

- name: Set the user full-name
  onyx_username:
      username: anass
      full_name: anasshami

- name: Set the user encrypted password
  onyx_username:
      username: anass
      password: 12345
      encrypted_password: True

- name: Set the user capability
  onyx_username:
      username: anass
      capability: monitor

- name: Reset the user capability
  onyx_username:
      username: anass
      reset_capability: True

- name: Remove the user configuration
  onyx_username:
      username: anass
      state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
commands
list / elements=string
always
The list of configuration mode commands to send to the device.

Sample:
['username *', 'username * password *', 'username * nopassword', 'username * disable login', 'username * capability admin', 'no username *', 'no username * disable']


Authors

  • Anas Shami (@anass)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/mellanox/onyx/onyx_username_module.html