community.general.pn_user (0.1.1) — module

CLI command to create/modify/delete user

Authors: Pluribus Networks (@rajaspachipulusu17)

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 can be used to create a user and apply a role, update a user and delete a user.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create user
  pn_user:
    pn_cliswitch: "sw01"
    state: "present"
    pn_scope: "fabric"
    pn_password: "foo123"
    pn_name: "foo"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete user
  pn_user:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_name: "foo"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify user
  pn_user:
    pn_cliswitch: "sw01"
    state: "update"
    pn_password: "test1234"
    pn_name: "foo"

Inputs

    
state:
    choices:
    - present
    - absent
    - update
    description:
    - State the action to perform. Use C(present) to create user and C(absent) to delete
      user C(update) to update user.
    required: true
    type: str

pn_name:
    description:
    - username.
    type: str

pn_scope:
    choices:
    - local
    - fabric
    description:
    - local or fabric.
    type: str

pn_password:
    description:
    - plain text password.
    type: str

pn_cliswitch:
    description:
    - Target switch to run the CLI on.
    required: false
    type: str

pn_initial_role:
    description:
    - initial role for user.
    type: str

Outputs

changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stderr:
  description: set of error responses from the user command.
  returned: on error
  type: list
stdout:
  description: set of responses from the user command.
  returned: always
  type: list