06-03-2019 06:27 AM
Has anyone worked with Ansible Tower and the ISE Tacacs server to query or add a network device ? It works using the ERS, but it failed when I use a playbook.
Here is the test playbook I am using:
--- - hosts: ISE connection: local tasks: - name: check ISE uri: url: https://Z.Z.Z.Z:9060/ers/config/networkdevice/?filter=name.EQ.WWW-FR-CHAMPIGNY-GMPLS-R-2 user: xxx password: yyy type: application/json "headers": {accept-type: application/json,content-type: application/json} force_basic_auth: yes force: yes validate_certs: no method: GET status_code: 200
Here is the error message that I get about an illegal header:
fatal: [ISE]: FAILED! => { "cache_control": "no-cache, no-store, must-revalidate", "changed": false, "connection": "close", "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><ns3:ersResponse operation=\"GET-getAll-networkdevice\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns3=\"ers.ise.cisco.com\"><link rel=\"related\" href=\"https://Z.Z.Z.Z:9060/ers/config/networkdevice/?filter=name.EQ.WWW-FR-CHAMPIGNY-GMPLS-R-2\" type=\"application/xml\"/><messages><message type=\"ERROR\" code=\"Resource media type exception\"><title>Illeagal Request Header: one or more of 'accept' / 'content-type' / 'ers-media-type' headers is not supported.</title></message></messages></ns3:ersResponse>", "content_length": "562", "content_type": "application/xml;charset=utf-8", "date": "Mon, 03 Jun 2019 13:19:01 GMT", "expires": "Thu, 01 Jan 1970 00:00:00 GMT",…
Any clue ?
Thanks
Gilles
Solved! Go to Solution.
06-17-2019 06:16 PM
Key is to make sure you use right content type and headers. I see that playbook is sending a header that ISE does not understand. Please check the ERS SDK documentation this will have full information.
Thanks
Krishnan
06-17-2019 06:16 PM
Key is to make sure you use right content type and headers. I see that playbook is sending a header that ISE does not understand. Please check the ERS SDK documentation this will have full information.
Thanks
Krishnan
06-19-2019 06:59 AM
I don't see any solution. This post is not solved.
I am asking for help and if you read the detail, you will ,notice that I have already read the ERS doc and it works with postman. I expect another kind of help from you.than "read the doc".
Gilles
06-19-2019 07:58 AM
06-20-2019 02:49 AM
Hi Surendra,
Even if I configure :
"headers": {accept: application/json,content-type: application/json}
Tower translates it into :
"headers": {
"content-type": "application/json",
"accept-type": "application/json"
},
It may definitely be a Tower issue.
Thanks for the help.
Gilles
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