gpt4 book ai didi

git - Ansible git 模块不 checkout 分支

转载 作者:太空狗 更新时间:2023-10-29 12:47:54 25 4
gpt4 key购买 nike

我正在使用 ansible 检查我在 EC2 网络实例上的网络应用程序。我的代码如下:

- name: Checkout the source code
git:
accept_hostkey=yes
depth=5
dest={{ webapp_dir }}
force=yes
key_file=/var/tmp/webapp_deploy_key
repo=git@github.com:MyRepo/web-app.git
update=yes
version={{ webapp_version }}
register: git_output

只要webapp_version = master就可以完美运行。但是一旦我输入 SHA1 或分支名称,它就会失败。

TASK: [webapp | Checkout the source code]
*************************************
failed: [52.17.69.83] => {"failed": true}
msg: Failed to checkout some-branch

这很奇怪。

我使用:

› ansible --version
ansible 1.9.1
configured module search path = None

最佳答案

我将再次回答我自己的一个问题。 depth=5 是 killer 。如果您想访问所有不同的版本,请不要使用它;)

关于git - Ansible git 模块不 checkout 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30799503/

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