nttmcp.mcp.user (1.0.9) — module

Create/Update/Remove User Accounts

| "added in version" 1.0.4 of nttmcp.mcp"

Authors: Ken Sinfield (@kensinfield)

preview | supported by community

Install collection

Install with ansible-galaxy collection install nttmcp.mcp:==1.0.9


Add to requirements.yml

  collections:
    - name: nttmcp.mcp
      version: 1.0.9

Description

Create/Update/Remove the user accounts for your organization


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: 127.0.0.1
  connection: local
  collections:
    - nttmcp.mcp
  tasks:

  - name: Create/Update a user
    user:
      region: na
      username: joeyjoejoe
      password: "{joey's password"
      fullname: Joey JoeJoe
      firstname: Joey
      lastname: JoeJoe
      email: joey.joejoe@abc.local
      roles:
        - network
        - server
        - vpn
      phone: 5555555555
      phone_country_code: 1
      department: Awesomeness
      custom_1: 1st Cool
      custom_2: 2nd Cool

  - name: Change a user's password
    user:
      region: na
      username: joeyjoejoe
      new_password: "joey's new password"

  - name: Delete a user
    user:
      region: na
      username: joeyjoejoe
      state: absent

Inputs

    
auth:
    description:
    - Optional dictionary containing the authentication and API information for Cloud
      Control
    required: false
    suboptions:
      api:
        description:
        - The Cloud Control API endpoint e.g. api-na.mcp-services.net
        required: false
        type: str
      api_version:
        description:
        - The Cloud Control API version e.g. 2.11
        required: false
        type: str
      password:
        description:
        - The Cloud Control API user password
        required: false
        type: str
      username:
        description:
        - The Cloud Control API username
        required: false
        type: str
    type: dict

email:
    description:
    - The email address of the user
    required: false
    type: str

phone:
    description:
    - The phone number of the user
    required: false
    type: int

roles:
    description:
    - List of roles for the user
    elements: str
    required: false
    type: list

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The action to be performed
    required: false
    type: str

region:
    default: na
    description:
    - The geographical region
    required: false
    type: str

my_user:
    default: false
    description:
    - Return just my user information
    - This does not require a Org/Primary administrator role
    - Users can only update password, fullname, firstname, lastname, email, phone and
      phone_country_code
    required: false
    type: bool

custom_1:
    description:
    - User defined custom attribute 1
    required: false
    type: str

custom_2:
    description:
    - User defined custom attribute 1
    required: false
    type: str

fullname:
    description:
    - The fullname of the user
    required: false
    type: str

lastname:
    description:
    - The lastname of the user
    required: false
    type: str

password:
    description:
    - The password to use
    required: false
    type: str

username:
    description:
    - The username to retrieve
    required: true
    type: str

firstname:
    description:
    - The fistname of the user
    required: false
    type: str

department:
    description:
    - The department of the user
    required: false
    type: str

new_password:
    description:
    - Used to change the password of an existing user
    required: false
    type: str

remove_phone:
    default: false
    description:
    - Remove the user's phone information
    required: false
    type: bool

phone_country_code:
    description:
    - The dialing code for the country of the user
    required: false
    type: int

Outputs

data:
  contains:
    count:
      description: The number of objects returned
      returned: success
      sample: 1
      type: int
    user:
      contains:
        emailAddress:
          description: The user's email address
          sample: john.doe@abc.local
          type: str
        firstName:
          description: The user's firstname
          sample: John
          type: str
        fullName:
          description: The user's full name
          sample: John Doe
          type: str
        lastName:
          description: The user's lastname
          sample: Doe
          type: str
        organization:
          contains:
            homeGeoApiHost:
              description: The user's home Geo API host
              sample: api-na.mcp-services.net
              type: str
            homeGeoId:
              description: The home Geo ID
              sample: northamerica
              type: str
            homeGeoName:
              description: The name of the home Geo
              sample: North America
              type: str
            id:
              description: The UUID of the home Geo
              sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
              type: str
            name:
              description: The organization name
              sample: myorg
              type: str
          description: Organizational level information about the user
          type: complex
        role:
          description: List of access roles associated with the user
          type: list
        state:
          description: The user's status
          sample: NORMAL
          type: str
        userName:
          description: The user ID
          sample: mysusername
          type: str
      description: User Object
      returned: success
      type: complex
  description: dict of returned Objects
  returned: success
  type: complex
msg:
  description: A useful message
  returned: success and state == absent
  sample: Request to Delete User has been accepted. Please use appropriate Get or
    List API for status.
  type: str