【问题标题】:My Ansible version is 2.8, yet the unique return values of the Git module are from 2.5我的 Ansible 版本是 2.8,但 Git 模块的唯一返回值来自 2.5
【发布时间】:2019-12-17 09:18:29
【问题描述】:

Ansible 2.5 的 Git 模块只返回几个唯一的返回值,而 Ansible 2.8 的 git 模块返回更多唯一的返回值,例如 git_dir_now。我在 Ubuntu 18.04 LTS 上运行 Ansible 2.8,并且使用 gid 模块,我得到的唯一返回值没有 git_dir_now

Ansible 2.5 Git 模块文档:https://docs.ansible.com/ansible/2.5/modules/git_module.html#id6

Ansible 2.8 Git 模块文档:https://docs.ansible.com/ansible/latest/modules/git_module.html#id6

我已经尝试完全重新安装 Ansible 和 Git,但没有结果。

- name: Clone repository for back-end
  git:
    repo: "git@gitlab.com:[my_repo]"
    dest: /home/ubuntu/myfolder
    version: master
    accept_hostkey: yes
  register: clonedgit
  notify: 
    - set nginx directory be
- debug: msg="{{ clonedgit }}"

我只得到这些值:

我只得到这些返回值,但由于我使用的是 Ansible 2.8,所以我也应该得到其他值,例如 git_dir_now

【问题讨论】:

    标签: git ansible


    【解决方案1】:

    我刚刚发现为什么会这样。

    "git_dir_now" : "如果 .git 目录被更改,则包含新路径"

    这意味着如果我们传递带有单独目录的参数“separate_git_dir”来克隆repo,将返回“git_dir_now”。

    我想要这个返回值,因为我想获得创建的存储库目录的完整路径。不同的 VCS 创建不同的目录名称,例如 GitLab 添加破折号,而其他的则不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      • 1970-01-01
      • 2018-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-12
      相关资源
      最近更新 更多