03-14-2024 09:55 AM
Hi Team,
Looking for Ansible API for the particular "Common Task type" to set as Nexus and by default it will choose Shell using API
Please help me with the exact API or reference link
03-14-2024 03:28 PM
There is no such for those 'Common Task Types'. You would need to select the Raw View tab and build your API calls based on that data.
Example:
{
"TacacsProfile": {
"id": "e09c3a20-e250-11ee-a3a8-1296ee463e27",
"name": "Nexus_RO",
"description": "",
"sessionAttributes": {
"sessionAttributeList": [
{
"type": "OPTIONAL",
"name": "shell:roles",
"value": "\"network-operator\""
}
]
},
"link": {
"rel": "self",
"href": "https://ise32-3.ise.trappedunderise.com:9060/ers/config/tacacsprofile/e09c3a20-e250-11ee-a3a8-1296ee463e27",
"type": "application/json"
}
}
}
03-14-2024 04:01 PM
The easiest way to do this is to configure it in the GUI like you have done then perform a GET on the respective API object (tacacsprofile) to see what the REST object looks like:
curl --include --insecure --location \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--user $ISE_REST_USERNAME:$ISE_REST_PASSWORD \
--request GET https://$ISE_HOSTNAME/ers/config/tacacsprofile/name/ReadOnly
{
"TacacsProfile" : {
"id" : "a8696100-e255-11ee-a872-5600453c2db2",
"name" : "ReadOnly",
"description" : "",
"sessionAttributes" : {
"sessionAttributeList" : [ {
"type" : "OPTIONAL",
"name" : "shell:roles",
"value" : "\"network-operator\""
} ]
},
"link" : {
"rel" : "self",
"href" : "https://198.18.133.27/ers/config/tacacsprofile/name/ReadOnly",
"type" : "application/json"
}
}
}
You can then use that data to figure out what values to use in the respective cisco.ise.tacacs_profile module:
- name: Create TACACS Profile `ReadOnly`
cisco.ise.tacacs_profile:
ise_hostname: "{{ise_hostname}}"
ise_username: "{{ise_username}}"
ise_password: "{{ise_password}}"
ise_verify: "{{ise_verify}}"
state: present
description: string
name: ReadOnly
sessionAttributes:
sessionAttributeList:
- name: "shell:roles"
type: OPTIONAL
value: "\"network-operator\""
03-20-2024 12:49 PM
Thanks @thomas @Greg Gibbs for the inputs. Let me check on the same.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide