debops-tools icon indicating copy to clipboard operation
debops-tools copied to clipboard

make misc/scripts/bootstrap_ansible more proxy friendly

Open muelli opened this issue 10 years ago • 4 comments

Currrently, it uses

project="git://github.com/ansible/ansible.git"

which is not friendly for people behind a proxy, because setting up git to use the git protocol via a proxy is much more painful than setting it up to use HTTP through a proxy.

The HTTP URL seems to work well, so I suggest to use that instead.

muelli avatar Apr 27 '15 15:04 muelli

Will it work with https:// URL as well?

drybjed avatar Apr 27 '15 15:04 drybjed

yes :) When https_proxy is set.

muelli avatar Apr 27 '15 15:04 muelli

Great, I'll switch it then when I get a chance, or you could post a PR. Also, come over to #debops @ FreeNode if you want, some issues could be solved better in real time. :)

drybjed avatar Apr 27 '15 15:04 drybjed

It seems that #109 is already fixing some of the proxy issues mentioned here, however, I have another special case where the debops-update script is not working well with git:// URIs.

In my case, outgoing traffic is only open to port 443. Requests to port 9418 are silently dropped. This leads to the following interesting side effect:

  • when running debops-update on a fresh installation, fetching the first role ansible-role-ansible succeeds, as the role name lookup heuristic which first tries to lookup the wrong role name ansible-ansible is falling back to the correct name after the timeout (return code 128) of the git ls-remote towards the blocked git:// URI (I added some debug statements to show the variable assignment):

    DEBUG: remote_uri = git://github.com/debops/ansible-ansible
    DEBUG: repo_status = 128
    DEBUG: remote_uri = https://github.com/debops/ansible-role-ansible
    Installing https://github.com/debops/ansible-role-ansible [master] (1/73)
    
  • for the subsequent roles which have a different naming scheme, the algorithm fails, as the second name which is requested is obviously wrong:

    DEBUG: remote_uri = git://github.com/debops/ansible-apt
    DEBUG: repo_status = 128
    DEBUG: remote_uri = https://github.com/debops/ansible-role-apt
    Installing https://github.com/debops/ansible-role-apt [master] (2/73)
    Username for 'https://github.com':
    
  • if I change the script to completely get rid of the git:// URI prefix, the first role will hang with an invalid URL.

  • the nasty thing is, that the HTTP and the git protocol don't behave the same when given an invalid URL and that the script behaviour is guessing the correct role name based on that. This makes it impossible at the moment to run the update over HTTPS only.

However, I think it should be possible to rename the ansible-role-ansible and at the same time get rid of the git:// prefix without breaking anything... What do you think?

ganto avatar May 25 '15 00:05 ganto