cisco.intersight.intersight_target_claim (2.0.8) — module

Target claim configuraiton for Cisco Intersight

Authors: Brandon Beck (@techBeck03), CiscoUcs (@CiscoUcs)

preview | supported by community

Install collection

Install with ansible-galaxy collection install cisco.intersight:==2.0.8


Add to requirements.yml

  collections:
    - name: cisco.intersight
      version: 2.0.8

Description

Target claim configuraiton for Cisco Intersight

Used to claim or unclaim a Target from Cisco Intersight

For more information see L(Cisco Intersight,https://intersight.com/apidocs).

Usage examples

Scanned by Steampunk Spotter
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Claim new Target
  cisco.intersight.intersight_target_claim:
    device_id: "{{ device_id }}"
    claim_code: "{{ claim_code }}"
    state: present
Scanned by Steampunk Spotter
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a Target (unclaim)
  cisco.intersight.intersight_target_claim:
    device_id: "{{ device_id }}"
    state: absent

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - If C(present), will verify the resource is present and will create if needed.
    - If C(absent), will verify the resource is absent and will delete if needed.
    type: str

api_uri:
    default: https://intersight.com/api/v1
    description:
    - URI used to access the Intersight API.
    - If not set, the value of the INTERSIGHT_API_URI environment variable is used.
    type: str

device_id:
    description:
    - Device id (serial number) of target
    - Targets containing multiple Target ids (e.g. IMM) can be formatted as <target1_id>&<target2_id>
    required: true
    type: str

use_proxy:
    default: true
    description:
    - If C(no), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

api_key_id:
    description:
    - Public API Key ID associated with the private key.
    - If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.
    required: true
    type: str

claim_code:
    description:
    - Claim code required for registering a new Target
    - Required if I(state=present)
    required: false
    type: str

validate_certs:
    default: true
    description:
    - Boolean control for verifying the api_uri TLS certificate
    type: bool

api_private_key:
    description:
    - Filename (absolute path) or string of PEM formatted private key data to be used
      for Intersight API authentication.
    - If a string is used, Ansible vault should be used to encrypt string data.
    - Ex. ansible-vault encrypt_string --vault-id tme@/Users/dsoper/Documents/vault_password_file
      '-----BEGIN EC PRIVATE KEY-----
    - '    <your private key data>'
    - '    -----END EC PRIVATE KEY-----'''
    - If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is
      used.
    required: true
    type: path

Outputs

api_repsonse:
  description: The API response output returned by the specified resource.
  returned: always
  sample:
    api_response:
      Account:
        ClassId: mo.MoRef
        Moid: '8675309'
        ObjectType: iam.Account
        link: https://www.intersight.com/api/v1/iam/Accounts/8675309
      AccountMoid: '8675309'
      Ancestors: null
      ClassId: asset.DeviceClaim
      CreateTime: '2021-05-10T17:32:13.522665238Z'
      Device:
        ClassId: mo.MoRef
        Moid: '9035768'
        ObjectType: asset.DeviceRegistration
        link: https://www.intersight.com/api/v1/asset/DeviceRegistrations/9035768
      DisplayNames:
        short:
        - FDO241604EM&FDO24161700
      DomainGroupMoid: 5b4e48a96a636d6d346cd1c5
      ModTime: '2021-05-10T17:32:13.522665238Z'
      Moid: '8675309'
      ObjectType: asset.DeviceClaim
      Owners:
      - '90357688675309'
      PermissionResources: null
      SecurityToken: A95486674376E
      SerialNumber: FDO86753091&FDO86753092
      SharedScope: ''
      Tags: []
      trace_id: NB3e883980a98adace8f7b9c2409cced1a
  type: dict