CiscoDevNet / intersight-ansible

Cisco Intersight Ansible Collection
MIT License
16 stars 21 forks source link

Programmatically retrieve 'SecurityToken' from C220/240 rack servers? #36

Open mynamewastaken opened 4 years ago

mynamewastaken commented 4 years ago

I was reading through https://github.com/CiscoDevNet/intersight-ansible/blob/master/playbooks/claim_device.yml#L26 -- is it possible to pull that value programmatically from the server?

I didn't have much luck looking through the rack API, I also looked at the /appliance/DeviceClaim API for Intersight which seems like it would try to connect to the device in question to pull that token, but wasn't able to get that working.

Thanks, Tim

dsoper2 commented 1 year ago

Device IDs and SecurityTokens are available through the device connector API and there's a full example of automated claim in Python/Ansible at https://github.com/CiscoDevNet/intersight-python-utils/tree/main/config_targets