�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: pn_user
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete user
description:
- This module can be used to create a user and apply a role,
update a user and delete a user.
options:
pn_cliswitch:
description:
- Target switch to run the CLI on.
type: str
required: false
state:
description:
- State the action to perform. Use C(present) to create user and
C(absent) to delete user C(update) to update user.
type: str
required: true
choices: ['present', 'absent', 'update']
pn_scope:
description:
- local or fabric.
type: str
choices: ['local', 'fabric']
pn_initial_role:
description:
- initial role for user.
type: str
pn_password:
description:
- plain text password.
type: str
pn_name:
description:
- username.
type: str
sn
- name: Create user
pn_user:
pn_cliswitch: "sw01"
state: "present"
pn_scope: "fabric"
pn_password: "foo123"
pn_name: "foo"
- name: Delete user
pn_user:
pn_cliswitch: "sw01"
state: "absent"
pn_name: "foo"
- name: Modify user
pn_user:
pn_cliswitch: "sw01"
state: "update"
pn_password: "test1234"
pn_name: "foo"
s�
command:
description: the CLI command run on the target node.
returned: always
type: str
stdout:
description: set of responses from the user command.
returned: always
type: list
stderr:
description: set of error responses from the user command.
returned: on error
type: list
changed:
description: indicates whether the CLI caused changes on the target.
returned: always
type: bool
( t
AnsibleModule( t pn_clit run_cli( t run_commandsc C` sJ | j d } | d 7} t | | � d } | j � } | | k rF t St S( s�
This method checks for idempotency using the user-show command.
If a user already exists on the given switch, return True else False.
:param module: The Ansible module to fetch input parameters
:param cli: The CLI string
t pn_names&