cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2025
Views
0
Helpful
4
Replies

ISE 2.4 : Ansible Tower and ERS

gillessapene
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

kthiruve
Cisco Employee
Cisco Employee

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

View solution in original post

4 Replies 4

kthiruve
Cisco Employee
Cisco Employee

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

gillessapene
Level 1
Level 1

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

It’s not “accept-type” in the header it is just “accept”

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