It seems that whatever "headers" I configure, Tower always translates it
into :
"headers": {
"content-type": "application/json",
"accept-type": "application/json"
}
and the ISE needs only :
{
"accept": "application/json",
"content-type": "application/json"
}
Do you know a way to override the headers ?
On Tuesday, June 4, 2019 at 10:05:11 AM UTC+2, Gilles wrote:
>
> 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. It seems that it is a header issue.
>
> FYI: the same http command works with Postman with the same headers.
>
> 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
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/464ac159-d828-49ed-9c00-0b0331b891a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.