dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
169 stars 44 forks source link

`dokku_clone` hangs indefinitely, when providing incorrect git URL #92

Closed ltalirz closed 3 years ago

ltalirz commented 3 years ago

Description of problem

The following dokku_clone task hangs indefinitely:

- name: Create seekpath app
  dokku_clone:
    app: seekpath
    repository: https://github.com/materialscloud-org/tools-seekpath2    # <= not a github repo

The reason for this is that the dokku clone command waits for input:

$ dokku clone seekpath2 https://github.com/materialscloud-org/tools-seekpath2
-----> Creating seekpath2 from https://github.com/materialscloud-org/tools-seekpath2 master
Username for 'https://github.com':

Expected Results

I would expect the dokku_clone module to fail, if the URL provided requires additional authentication.

It should probably pass something like a --non-interactive flag to the dokku clone command (or can the ansible module detect if the command waits for input and fail?).

ltalirz commented 3 years ago

From dokku v0.23.0 there is the built-in git:sync command, and from v0.24.0 this command no longer has this issue:

$ dokku git:sync seekpath2 https://github.com/materialscloud-org/tools-seekpath2
-----> Cloning seekpath2 from https://github.com/materialscloud-org/tools-seekpath2#master
Cloning into '/var/lib/dokku/data/git/seekpath2'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled

The dokku_clone module of the ansible role was changed to use git:sync under the hood in https://github.com/dokku/ansible-dokku/pull/98 (will be available from the next release of the ansible role).