cisco.intersight.intersight_target_claim – Target claim configuraiton for Cisco Intersight

Note

This plugin is part of the cisco.intersight collection (version 1.0.18).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_target_claim.

New in version 2.8: of cisco.intersight

Synopsis

  • Target claim configuraiton for Cisco Intersight

  • Used to claim or unclaim a Target from Cisco Intersight

  • For more information see Cisco Intersight.

Parameters

Parameter Choices/Defaults Comments
api_key_id
string / required
Public API Key ID associated with the private key.
If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.
api_private_key
string / required
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 [email protected]/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.
api_uri
string
Default:
"https://intersight.com/api/v1"
URI used to access the Intersight API.
If not set, the value of the INTERSIGHT_API_URI environment variable is used.
claim_code
string
Claim code required for registering a new Target
Required if state=present
device_id
dictionary / required
Device id (serial number) of target
Targets containing multiple Target ids (e.g. IMM) can be formatted as <target1_id>&<target2_id>
state
string
    Choices:
  • present ←
  • absent
If present, will verify the resource is present and will create if needed.
If absent, will verify the resource is absent and will delete if needed.
use_proxy
boolean
    Choices:
  • no
  • yes ←
If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.
validate_certs
boolean
    Choices:
  • no
  • yes ←
Boolean control for verifying the api_uri TLS certificate

Examples

- name: Claim new Target
  cisco.intersight.intersight_target_claim:
    device_id: "{{ device_id }}"
    claim_code: "{{ claim_code }}"
    state: present

- name: Delete a Target (unclaim)
  cisco.intersight.intersight_target_claim:
    device_id: "{{ device_id }}"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
api_repsonse
dictionary
always
The API response output returned by the specified resource.

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': None, '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': None, 'SecurityToken': 'A95486674376E', 'SerialNumber': 'FDO86753091&FDO86753092', 'SharedScope': '', 'Tags': [], 'trace_id': 'NB3e883980a98adace8f7b9c2409cced1a'}}


Authors

  • Brandon Beck (@techBeck03)

  • CiscoUcs (@CiscoUcs)