[JIRA] (JENKINS-54341) Ansible Tower Plugin 0.9.0 not compatible with Tower 3.2.5

0 views
Skip to first unread message

rainer.montag@devoteam.com (JIRA)

unread,
Oct 30, 2018, 6:48:02 AM10/30/18
to jenkinsc...@googlegroups.com
Rainer Montag created an issue
 
Jenkins / Bug JENKINS-54341
Ansible Tower Plugin 0.9.0 not compatible with Tower 3.2.5
Issue Type: Bug Bug
Assignee: John Westcott
Components: ansible-tower-plugin
Created: 2018-10-30 10:47
Priority: Major Major
Reporter: Rainer Montag

Jenkins: 2.121.3

Ansible-Tower-Plugin: 0.9.0

Ansible Tower: 3.2.5

 

When configuring a Ansible Tower 3.2.5 connectivity with plugin version 0.9.0 it does not work (anymore?)

Plugin is issuing a POST "/api/v2/authtoken/" and retrieving a token: {"token":"2878104c539b9dd3526cd07280f596441d7b9e02","expires":"2018-10-30T09:56:23.351Z"}

Then Plugin is sending a GET Request "/api/v2/jobs/", but is sending the Header "Authorization: Bearer 2878104c539b9dd3526cd07280f596441d7b9e02" which will result in a 401 error {"detail":"Authentication credentials were not provided."}.

Problem is the "Bearer" value in the Header (introduced with OAuth  support for Tower 3.3 ?). The correct request needs to send the Header as "Authorization: Token 2878104c539b9dd3526cd07280f596441d7b9e02", then the command is working (from curl).

As a result, the plugin 0.9.0 is not working with Ansible Tower 3.2.5. I have currently no possibility to upgrade Ansible Tower to >= 3.3.

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

rainer.montag@devoteam.com (JIRA)

unread,
Nov 1, 2018, 6:32:02 AM11/1/18
to jenkinsc...@googlegroups.com
Rainer Montag commented on Bug JENKINS-54341
 
Re: Ansible Tower Plugin 0.9.0 not compatible with Tower 3.2.5

The method org.jenkinsci.plugins.ansible_tower.util.TowerVersion.is_greater_or_equal() in commit cc76e71bffafd5a64747a3fa703256afee12fc7a is broken:

public static void main(String[] args) throws AnsibleTowerException {
        TowerVersion v325 = new TowerVersion("3.2.5");
        TowerVersion v330 = new TowerVersion("3.3.0");
        System.out.println(v325.is_greater_or_equal("3.3.0"));
     } 

Returns "true"  As a result, the TowerConnector - which is perfoming the check will always use "Bearer" method and not the legacy "Token" method.

rainer.montag@devoteam.com (JIRA)

unread,
Nov 1, 2018, 6:33:02 AM11/1/18
to jenkinsc...@googlegroups.com
Rainer Montag edited a comment on Bug JENKINS-54341
The method org.jenkinsci.plugins.ansible_tower.util.TowerVersion.is_greater_or_equal() in commit cc76e71bffafd5a64747a3fa703256afee12fc7a   (https://github.com/jenkinsci/ansible-tower-plugin/commit/cc76e71bffafd5a64747a3fa703256afee12fc7a) is broken:
{code:java}

public static void main(String[] args) throws AnsibleTowerException {
        TowerVersion v325 = new TowerVersion("3.2.5");
        TowerVersion v330 = new TowerVersion("3.3.0");
        System.out.println(v325.is_greater_or_equal("3.3.0"));
     } {code}
Returns "true" :( As a result, the TowerConnector - which is perfoming the check will always use "Bearer" method and not the legacy "Token" method.

rainer.montag@devoteam.com (JIRA)

unread,
Nov 1, 2018, 6:39:02 AM11/1/18
to jenkinsc...@googlegroups.com
Rainer Montag edited a comment on Bug JENKINS-54341
The method org.jenkinsci.plugins.ansible_tower.util.TowerVersion.is_greater_or_equal() in commit cc76e71bffafd5a64747a3fa703256afee12fc7a  ( [ https://github.com/jenkinsci/ansible-tower-plugin/commit/cc76e71bffafd5a64747a3fa703256afee12fc7a ] ) is broken:

{code:java}
public static void main(String[] args) throws AnsibleTowerException {
        TowerVersion v325 = new TowerVersion("3.2.5");
        TowerVersion v330 = new TowerVersion("3.3.0");
        System.out.println(v325.is_greater_or_equal("3.3.0"));
     } {code}
Returns "true" :( As a result, the TowerConnector - which is perfoming the check will always use "Bearer" method and not the legacy "Token" method.

rainer.montag@devoteam.com (JIRA)

unread,
Nov 1, 2018, 6:56:01 AM11/1/18
to jenkinsc...@googlegroups.com

To workaround for our usage with Tower 3.2.5 we reverted the plugin back to 0.8.7 in our Jenkins instance.

john.westcott.iv@redhat.com (JIRA)

unread,
Dec 2, 2018, 5:47:02 PM12/2/18
to jenkinsc...@googlegroups.com

john.westcott.iv@redhat.com (JIRA)

unread,
Dec 2, 2018, 5:49:02 PM12/2/18
to jenkinsc...@googlegroups.com
 

Sorry for the delay, this issue should now be fixed in 0.9.1. Instead of using a version check to determine Token or Bearer we now using the same method as TowerCLI to better determine the correct course of action. If you find that 0.9.1 does not fix this issue please reopen the ticket.

Change By: John Westcott
Status: Fixed but Unreleased Resolved
Released As: 0.9.1

john.westcott.iv@redhat.com (JIRA)

unread,
Jan 8, 2020, 9:56:03 AM1/8/20
to jenkinsc...@googlegroups.com
John Westcott closed an issue as Fixed
Change By: John Westcott
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages