community.general.pn_role (0.1.1) — module

CLI command to create/delete/modify role

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, delete and modify user roles.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Role create
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'present'
    pn_name: 'foo'
    pn_scope: 'local'
    pn_access: 'read-only'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Role delete
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'absent'
    pn_name: 'foo'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Role modify
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'update'
    pn_name: 'foo'
    pn_access: 'read-write'
    pn_sudo: true
    pn_shell: true

Inputs

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

pn_name:
    description:
    - role name.
    required: true
    type: str

pn_sudo:
    description:
    - allow sudo from shell.
    required: false
    type: bool

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

pn_shell:
    description:
    - allow shell command.
    required: false
    type: bool

pn_access:
    choices:
    - read-only
    - read-write
    description:
    - type of access.
    required: false
    type: str

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

pn_running_config:
    description:
    - display running configuration of switch.
    required: false
    type: bool

pn_delete_from_users:
    description:
    - delete from users.
    required: false
    type: bool

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 role command.
  returned: on error
  type: list
stdout:
  description: set of responses from the role command.
  returned: always
  type: list