gpt4 book ai didi

git - 来自 Bitbucket.org 的 ansible-galaxy 和 git clone

转载 作者:太空狗 更新时间:2023-10-29 13:10:07 24 4
gpt4 key购买 nike

我正在使用 ansible-galaxy (v2.0.0.2) 安装 ansible 角色,它通过 requirements.yml 文件在 Bitbucket 上有源代码。但是我无法使用私钥从 bitbucket.org check out 代码。这是错误信息,也是我的requirements.yml内容。

有人知道 ansible-galaxy 2.0.0.2 的正确 requirements.yml 文件格式是什么吗?

  + ansible-galaxy -vvv install --force --role-file ansible/requirements.yml --roles-path ./ansible/roles

Using /etc/ansible/ansible.cfg as config file
Opened /tmp/.ansible_galaxy
found role {'scm': 'git', 'src': 'git@bitbucket.org:myrepo/nginx.git', 'version': 'latest', 'name': 'nginx'} in yaml file
Installing role nginx

[WARNING]: - nginx was NOT installed successfully: - command git checkout
latest failed in directory /tmp/tmpQRZc8j (rc=1)
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

[requirements.yml]

- name: nginx
src: git@bitbucket.org:myrepo/nginx.git
scm: git
version: latest
accept_hostkey: yes
key_file: /tmp/.ssh/id_rsa

最佳答案

也许 scp 语法不起作用。网址可能是:

ssh://git@bitbucket.org/myrepo/nginx.git

尝试,如 this ansible issue :

Direct copy from github clone repo path

git@github.com:geerlingguy/ansible-role-php.git

Actual URL that works

ssh://git@github.com/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.

关于git - 来自 Bitbucket.org 的 ansible-galaxy 和 git clone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41755543/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com