Bug 1540551 - [RFE] CFME, add Ansible GIT repository custom SSH port option
Summary: [RFE] CFME, add Ansible GIT repository custom SSH port option
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: GA
: 5.10.0
Assignee: Zita Nemeckova
QA Contact: Satyajit Bulage
URL:
Whiteboard:
Depends On:
Blocks: 1562803
TreeView+ depends on / blocked
 
Reported: 2018-01-31 11:42 UTC by Vladimir Dulava
Modified: 2021-06-10 14:24 UTC (History)
13 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1562803 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:04:26 UTC
Category: Feature
Cloudforms Team: Ansible
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Created a project/repo using custom port (64.80 KB, image/png)
2018-03-01 19:09 UTC, James Wong
no flags Details
3 playbooks found in the git repo (34.81 KB, image/png)
2018-03-01 19:10 UTC, James Wong
no flags Details
API call takes scm_url correctly (567.99 KB, image/png)
2018-03-27 13:11 UTC, Zita Nemeckova
no flags Details

Description Vladimir Dulava 2018-01-31 11:42:28 UTC
Description of problem:
It is not possible to use GIT repository for Ansible playbooks via SSH using custom port without editing the SSH configs via CLI.

In CFME version 4.5 and lower, it was possible to achieve this via adding the host with custom port to .ssh/config in awx user home.

In CFME 4.6b, the .ssh/config file is ignored so to achieve the same thing it is possible to do it via /etc/ssh/ssh_config.

In the GUI, if the port is used in the address [1], the tool interprets the port as part of the path, so this workaround doesn't work.

The option to set the custom SSH port would be very useful.

[1] git@<server>:<port><path_to_repo>


Version-Release number of selected component (if applicable):
N/A

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
Not able to connect GIT repo via SSH connection using the GUI only. The config files on the OS must be edited to achieve this.

Expected results:
To be able to set the custom SSH port via GUI

Comment 9 James Wong 2018-03-01 19:09:48 UTC
Created attachment 1402744 [details]
Created a project/repo using custom port

Comment 10 James Wong 2018-03-01 19:10:28 UTC
Created attachment 1402745 [details]
3 playbooks found in the git repo

Comment 11 James Wong 2018-03-01 19:14:19 UTC
Vladimir,

The git server is not accessible somehow. I set up my own and I am able to add it. I am able to add using both https and ssh* with the custom port in the url. See the attached screen shots for the ssh one.

ssh*: UI doesn't allow `ssh` protocol url. So I did that using rails console.


So if you problem is with https custom-port, I cannot reproduce it.  If your issue is with the 'ssh'. Please assign to UI team to enable that.

Let me know if question.

Thanks,
James

Comment 12 Vladimir Dulava 2018-03-02 13:40:36 UTC
(In reply to James Wong from comment #11)
> Vladimir,
> 
> The git server is not accessible somehow. I set up my own and I am able to
> add it. I am able to add using both https and ssh* with the custom port in
> the url. See the attached screen shots for the ssh one.
> 
> ssh*: UI doesn't allow `ssh` protocol url. So I did that using rails console.
> 
> 
> So if you problem is with https custom-port, I cannot reproduce it.  If your
> issue is with the 'ssh'. Please assign to UI team to enable that.
> 
> Let me know if question.
> 
> Thanks,
> James

Hi. Ok. THis problem is related to the custom port on ssh.

I am going to reassign the BZ.

Thanks,

Vladimir

Comment 14 Zita Nemeckova 2018-03-27 13:11:18 UTC
Created attachment 1413718 [details]
API call takes scm_url correctly

Comment 15 Martin Hradil 2018-03-28 11:15:25 UTC
So, the problem is this:

    git@<server>:<port><path_to_repo>

is *not* a valid way of specifying a server with port.

`ssh server:port` will try resolving server:port as one hostname
`git clone server:port/path` will try connecting to server, and cloning port/path


So, that part of the behavior is completely correct :).



The way to specify a git url with custom port is using the ssh:// protocol:

`git clone ssh://server:port/path` does do the right thing.

But unfortunately we only allow pure ssh paths (which don't support ports) and http/https URIs (which don't use the right protocol).


The solution here will be to add support for specifying the ssh:// protocol in the UI.

Comment 17 CFME Bot 2018-03-29 08:37:21 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/109a93e12bbbda4f2c20269763c37b5256d3cf6b
commit 109a93e12bbbda4f2c20269763c37b5256d3cf6b
Author:     Zita Nemeckova <znemecko>
AuthorDate: Wed Mar 28 08:36:18 2018 -0400
Commit:     Zita Nemeckova <znemecko>
CommitDate: Wed Mar 28 08:36:18 2018 -0400

    Allow scm_url to take ssh with ssh protocol

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1540551

    Allows http, https, ssh protocols. Allows ssh without protocol.

 app/assets/javascripts/directives/url_validation.js | 18 +-
 app/views/ansible_repository/_repository_form.html.haml | 2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)

Comment 20 Satyajit Bulage 2019-01-25 12:28:23 UTC
Able to add repo with git server running on different port.

Verified Version: 5.10.0.32.20190115185124_c957ada


Note You need to log in before you can comment on or make changes to this bug.