charlesrocket.git
git_role
在 Unix/Linux 机器上使用 Ansible 安装 Git。
设置
运行 ansible-galaxy install charlesrocket.git
或使用 requirements.yml
:
roles:
- name: charlesrocket.git
示例
- name: Playbook
hosts: all
roles:
- charlesrocket.git
凭证助手
定义以下变量以部署凭证助手:
git_repo_destination: "~/gitlab/git" # git 仓库目标
git_helper_directory: "~/bin" # 辅助程序目录
git_helper: ["netrc"]
- 添加
git_repo_shallow: true
来使用浅克隆。 - 添加
git_repo_force: true
来覆盖本地修改。