GCP Source repositories with Ansible

Hi guys, I would like to know if it is possible to use GCP source repositories in my Morpheus Ansible integration. I already configured the repository in GCP to test, but I am getting a couple of errors when trying to do the integration. The procedure I am following is pretty straightforward:

GCP Source Repository

  1. Create the repository.
  2. adding ssh key in the GCP repo
  3. cloning the repo
  4. add some content.

Morpheus:

  1. Administration → Integrations → New Integration → Ansible
  2. Filling the fields Name, Ansible Git URL, default branch, Playbooks path, etc.
  3. in the Git section, I select the Key Pair previously created (matches with the one I have in the repository), add the username and password, then it fails.

Reviewing my other Ansible integration, the only difference is the access token created in my other repository. However in the GCP source repository, I cannot see this option, so I just skipped it during the creation. Have you guys had some experience adding this type of repos? is it possible to use GCP source repositories for the ansible integrations?

I am also seeing a “redirection blocked” error in the morpheus logs, something like this:
[appJobNormal-14] remoteGitFetch error: org.eclipse.jgit.api.errors.TransportException: myrepodetails.git: Redirection blocked: redirect myrepodetails.git/ → source.cloud.google.com/onboarding/welcome not allowed org.eclipse.jgit.api.errors.TransportException: myrepodetails.git: Redirection blocked: redirect myrepodetails.git/ → source.cloud.google.com/onboarding/welcome not allowed at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224) at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:311) at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:182) at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:1) at java_util_concurrent_Callable$call$58.call(Unknown Source) at com.morpheus.integration.GitRepoService.executeGitCommand(GitRepoService.groovy:703) at jdk.internal.reflect.GeneratedMethodAccessor6535.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at com.morpheus.integration.GitRepoService.remoteGitFetch(GitRepoService.groovy:376) [4 skipped] at com.morpheus.integration.GitRepoService$remoteGitFetch$0.callCurrent(Unknown Source) at com.morpheus.integration.GitRepoService.loadGitRepoFiles(GitRepoService.groovy:93) at com.morpheus.integration.GitRepoService.loadGitRepoFiles(GitRepoService.groovy) at com.morpheus.integration.GitRepoService$loadGitRepoFiles.call(Unknown Source) at com.morpheus.automation.AnsibleService.testConfigManagement(AnsibleService.groovy:173) at com.morpheus.automation.AnsibleService.testConfigManagement(AnsibleService.groovy) at com.morpheus.automation.AnsibleService$testConfigManagement$0.callCurrent(Unknown Source) at com.morpheus.automation.AnsibleService.refreshAccountIntegration(AnsibleService.groovy:144) at com.morpheus.automation.AnsibleService$refreshAccountIntegration.call(Unknown Source) at com.morpheus.automation.ConfigManagementService.refreshAccountIntegration(ConfigManagementService.groovy:37) at com.morpheus.automation.ConfigManagementService$refreshAccountIntegration.call(Unknown Source) at com.morpheus.AccountIntegrationService.refreshAccountIntegration(AccountIntegrationService.groovy:413) at com.morpheus.AccountIntegrationService.refreshAccountIntegration(AccountIntegrationService.groovy) at com.morpheus.AccountIntegrationService$refreshAccountIntegration$0.call(Unknown Source) at com.morpheus.ApplianceJobService.executeApplianceJob(ApplianceJobService.groovy:596) at jdk.internal.reflect.GeneratedMethodAccessor1399.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at com.morpheus.ApplianceJobService$_onApplianceJob_closure2.doCall(ApplianceJobService.groovy:294) [6 skipped] at com.morpheus.ApplianceJobService$_onApplianceJob_closure2.doCall(ApplianceJobService.groovy) at jdk.internal.reflect.GeneratedMethodAccessor1391.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at com.morpheus.ApplianceJobService$_onApplianceJob_closure3.doCall(ApplianceJobService.groovy:361) [7 skipped] at jdk.internal.reflect.GeneratedMethodAccessor1390.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at com.morpheus.util.BoundedExecutor$2.run(BoundedExecutor.java:47) [7 skipped] [3 skipped] Caused by: org.eclipse.jgit.errors.TransportException: myrepodetails.git: Redirection blocked: redirect myrepodetails.git/ → onboarding/welcome not allowed at org.eclipse.jgit.transport.TransportHttp.redirect(TransportHttp.java:952) at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:710) at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:141) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:93) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1317) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213) … 60 common frames omitted

Hi @BorisAyala ,

Through testing it appears the JGIT connector does not honor the required 2022 port that Google repositories require for SSH connectivity.

As for the HTTPS connectivity, the method Google uses seems very non-standard establishing a machine cookie, and seems wider scoped than intended and would not be best practice.

An idea could be put in to support non-standard SSH ports, and may be able to resolve your connectivity issue.