ansible-galaxy and git clone from Bitbucket.org

Solution 1:

Maybe the scp syntax does not work. The url one might:

ssh://[email protected]/myrepo/nginx.git

Try, as in this ansible issue:

Direct copy from github clone repo path

[email protected]:geerlingguy/ansible-role-php.git

Actual URL that works

ssh://[email protected]/geerlingguy/ansible-role-php.git

You have to replace the : with a /.
And it needs to be a URL (i.e. contain ://) otherwise ansible-galaxy assumes it's a filesystem path.

Solution 2:

try git+ssh schema

works on ansible-galaxy 2.7.8

ansible-galaxy install git+ssh://bitbucket.org:<username>/<role-name>.git

Solution 3:

If you set "scm: git" underneath the src, galaxy will run "git clone XYZ" where XYZ is your src: field. So, anything you can "git clone XYZ" is what you put in the src field.

- src: ssh://[email protected]:8899/project/repo-name.git
  scm: git

For the private key, in case it's not your default ssh key, we use ssh-agent(1) (see manpage for usage).