nttmcp.mcp.server_vapp (1.0.9) — module

Enable/Disable and set/delete vApp properties on a server

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

Authors: Ken Sinfield (@kensinfield)

preview | supported by NTT Ltd.

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

Enable/Disable and set/delete vApp properties on a server

https://docs.mcp-services.net/x/qIAkAQ


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: Enable and Set vApp properties on a server
    server_vapp:
      region: na
      datacenter: NA12
      network_domain: myCND
      server: myServer01
      iso: True
      vmtools: True
      vapp:
        - key: 0
          id: ipv4_address
          class_id: my_vapp
          instance_id: 1
          category: Network_Properties
          label: "Management IPv4 Address"
          description: "vApp Management IPv4 Address"
          type: ip
          value: 10.0.0.10
        - key: 1
          id: default_password
          class_id: my_vapp
          instance_id: 1
          category: System_Properties
          label: "Initial system password"
          description: "Initial system password"
          type: "password(8..20)"
          value: cool_password

  - name: Update a property
    server_vapp:
      region: na
      datacenter: NA12
      network_domain: myCND
      server: myServer01
      iso: True
      vmtools: True
      vapp:
        - key: 1
          id: default_password
          class_id: my_vapp
          instance_id: 1
          category: System_Properties
          label: "Initial system password"
          description: "Initial system password - new description"
          type: "password(8..20)"
          value: new_cool_password

  - name: Delete a property
    server_vapp:
      region: na
      datacenter: NA12
      network_domain: myCND
      server: myServer01
      vapp:
        - key: 1
      state: absent

  - name: Disable vApp completely and remove all properties
    server_vapp:
      region: na
      datacenter: NA12
      network_domain: myCND
      server: myServer01
      state: absent

Inputs

    
iso:
    default: false
    description:
    - Use ISO transport. vCenter uses a small ISO image on the first available CDROM drive
      to store the
    - ovf-env.xml file with the vApp properties
    required: false
    type: bool

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

vapp:
    description:
    - List of vApp property objects
    elements: dict
    required: false
    suboptions:
      category:
        description:
        - Optional string intended for property categorization
        required: false
        type: str
      class_id:
        description:
        - Optional hypervisor class name for the property
        required: false
        type: str
      configurable:
        default: true
        description:
        - Boolean defining whether or not the property can have a user defined value
        required: false
        type: bool
      default_value:
        description:
        - String default value for the property if no value is specified
        required: false
        type: str
      description:
        description:
        - Optional string descriptive metadata about the property
        required: false
        type: str
      id:
        description:
        - Hypervisor id name for the property..
        required: false
        type: str
      instance_id:
        description:
        - Optional hypervisor instanceId name for the property
        required: false
        type: str
      key:
        description:
        - Integer used for identifying a target property for update by set or for deletion
          by delete
        - IMPORTANT key is not directly retrievable within the Guest OS. Instead guestKey
          can be retrieved
        required: false
        type: int
      label:
        description:
        - Optional string display name for the property
        required: false
        type: str
      type:
        description:
        - Defines the data type of the property
        - For definitions of the supported vApp Property type formats refer to the Response
          Codes table
        - below and to Introduction to vApp Properties "https://docs.mcp-services.net/x/qIAkAQ"
        - When using some types e.g. ip it is best to set a default_value if an actual
          value is not set
        - even if its 0.0.0.0
      value:
        description:
        - value for the property
        - Can only be provided if userConfigurable is true either in the same payload
          or already existing
        - in the persisted schema definition for the vApp Property
        required: false
        type: str
    type: list

wait:
    default: true
    description:
    - Should Ansible wait for the task to complete before continuing
    required: false
    type: bool

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

server:
    description:
    - The name of the server
    required: true
    type: str

vmtools:
    default: true
    description:
    - Use VMWare Tools transport. The vApp properties are available through VMWare Tools
      or Open-VM-Tools
    - within the guest OS
    required: false
    type: bool

wait_time:
    default: 600
    description: The maximum time the Ansible should wait for the task to complete in
      seconds
    required: false
    type: int

datacenter:
    description:
    - The datacenter name
    required: true
    type: str

network_domain:
    description:
    - The name of the Cloud Network Domain
    required: true
    type: str

wait_poll_interval:
    default: 5
    description:
    - The time in between checking the status of the task in seconds
    required: false
    type: int

Outputs

data:
  contains:
    isoTransport:
      description: Enable ISO transport for vApp properties
      type: bool
    vAppProperty:
      contains:
        key:
          description: The unique key identifier
          sample: 2
          type: int
        schema:
          contains:
            category:
              description: User defined property category
              sample: Network_Properties
              type: str
            classId:
              description: User defined Class ID
              sample: my_vapp
              type: str
            defaultValue:
              description: The default value for the vApp property
              sample: 0.0.0.0
              type: str
            description:
              description: The vApp property description
              sample: vApp Management IPv4 Address2
              type: str
            id:
              description: The string ID of the property. This is used inside the
                guest OS
              sample: ipv4_address2
              type: str
            instanceId:
              description: User defined instance ID
              sample: 1
              type: str
            label:
              description: User defined optional label
              sample: Management IPv4 Address2
              type: str
            type:
              description: The vApp property type
              sample: ip
              type: str
            userConfigurable:
              description: Can the user configure this vApp property
              type: bool
          description: The schema for the vApp property
          type: complex
        value:
          description: The property value. This is used inside the guest OS
          sample: 10.0.0.11
          type: str
      description: The list of vApp properties
      type: list
    vmwareTransport:
      description: Enable VMWare Tools/Open-VM-Tools transport for vApp properties
      type: bool
  description: Server objects
  returned: success
  type: complex
msg:
  description: A helpful message
  returned: failure and on no change
  sample: No update required
  type: str