无法签出到新分支 - ansible git

问题描述 投票:0回答:1

我正在尝试创建一个剧本,只需更改变量即可签出到任何分支。剧本的 git 部分是:

- name: Clone repository
  git: 
    repo: "{{ repo_url }}"
    dest: /some_path
    key_file: some_path_to_a_file
    version: "{{ repo_tag }}"
    force: yes

我第一次使用

repo_tag=master
并且它有效。然后我创建了一个名为 dev 的新分支并尝试使用
repo_tag=dev
。它说它无法签出该标签。问题似乎是在结帐之前未获取模块。

我在游戏中做错了什么?

编辑: 作为临时解决方法,我只是在克隆之前删除存储库文件夹,但这会强制进行克隆,即使没有必要也是如此。

git ansible
1个回答
0
投票
自从这个问题发布以来,

lib/ansible/modules/git.py中的许多问题

都得到了修复。

使用

ansible-core 2.16.4

 这是不可重现的。

© www.soinside.com 2019 - 2024. All rights reserved.