community.general.avi_user (0.1.1) — module

Avi User Module

Authors: Shrikant Chaudhari (@gitshrikant) <shrikant.chaudhari@avinetworks.com>

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 for creation, updation and deletion of a user.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: user creation
    avi_user:
      controller: ""
      username: ""
      password: ""
      api_version: ""
      name: "testuser"
      obj_username: "testuser"
      obj_password: "test123"
      email: "test@abc.test"
      access:
        - role_ref: "/api/role?name=Tenant-Admin"
          tenant_ref: "/api/tenant/admin#admin"
      user_profile_ref: "/api/useraccountprofile?name=Default-User-Account-Profile"
      is_active: true
      is_superuser: true
      default_tenant_ref: "/api/tenant?name=admin"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: user creation
    avi_user:
      controller: ""
      username: ""
      password: ""
      api_version: ""
      name: "testuser"
      obj_username: "testuser2"
      obj_password: "password"
      email: "testuser2@abc.test"
      access:
        - role_ref: "https://192.0.2.10/api/role?name=Tenant-Admin"
          tenant_ref: "https://192.0.2.10/api/tenant/admin#admin"
      user_profile_ref: "https://192.0.2.10/api/useraccountprofile?name=Default-User-Account-Profile"
      is_active: true
      is_superuser: true
      default_tenant_ref: "https://192.0.2.10/api/tenant?name=admin"

Inputs

    
name:
    description:
    - Full name of the user.
    required: true
    type: str

email:
    description:
    - Email address of the user. This field is used when a user loses their password and
      requests to have it reset. See Password Recovery.
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - The state that should be applied on the entity.
    type: str

access:
    description:
    - Access settings (write, read, or no access) for each type of resource within Vantage.
    type: list

tenant:
    default: admin
    description:
    - Name of tenant used for all Avi API calls and context of object.
    type: str

password:
    default: ''
    description:
    - Password of Avi user in Avi controller. The default value is the environment variable
      C(AVI_PASSWORD).
    type: str

username:
    default: ''
    description:
    - Username used for accessing Avi controller. The default value is the environment
      variable C(AVI_USERNAME).
    type: str

is_active:
    description:
    - Activates the current user account.
    type: bool

controller:
    default: ''
    description:
    - IP address or hostname of the controller. The default value is the environment variable
      C(AVI_CONTROLLER).
    type: str

api_context:
    description:
    - Avi API context that includes current session ID and CSRF Token.
    - This allows user to perform single login and re-use the session.
    type: dict

api_version:
    default: 16.4.4
    description:
    - Avi API version of to use for Avi API and objects.
    type: str

tenant_uuid:
    default: ''
    description:
    - UUID of tenant used for all Avi API calls and context of object.
    type: str

is_superuser:
    description:
    - If the user will need to have the same privileges as the admin account, set it to
      true.
    type: bool

obj_password:
    description:
    - You may either enter a case-sensitive password in this field for the new or existing
      user.
    required: true
    type: str

obj_username:
    description:
    - Name that the user will supply when signing into Avi Vantage, such as jdoe or jdoe@avinetworks.com.
    required: true
    type: str

avi_credentials:
    description:
    - Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller
      login details.
    suboptions:
      api_version:
        default: 16.4.4
        description:
        - Avi controller version
      controller:
        description:
        - Avi controller IP or SQDN
      csrftoken:
        description:
        - Avi controller API csrftoken to reuse existing session with session id
      password:
        description:
        - Avi controller password
      port:
        description:
        - Avi controller port
      session_id:
        description:
        - Avi controller API session id to reuse existing session with csrftoken
      tenant:
        default: admin
        description:
        - Avi controller tenant
      tenant_uuid:
        description:
        - Avi controller tenant UUID
      timeout:
        default: 300
        description:
        - Avi controller request timeout
      token:
        description:
        - Avi controller API token
      username:
        description:
        - Avi controller username
    type: dict

avi_api_patch_op:
    choices:
    - add
    - replace
    - delete
    description:
    - Patch operation to use when using avi_api_update_method as patch.
    type: str

user_profile_ref:
    description:
    - Refer user profile.
    - This can also be full URI same as it comes in response payload
    type: str

default_tenant_ref:
    default: /api/tenant?name=admin
    description:
    - Default tenant reference.
    - This can also be full URI same as it comes in response payload
    type: str

avi_api_update_method:
    choices:
    - post
    - put
    - patch
    default: put
    description:
    - Default method for object update is HTTP PUT.
    - Setting to patch will override that behavior to use HTTP PATCH.
    type: str

avi_disable_session_cache_as_fact:
    description:
    - It disables avi session information to be cached as a fact.
    type: bool

Outputs

obj:
  description: Avi REST resource
  returned: success, changed
  type: dict