美文网首页
ansible git模块

ansible git模块

作者: mini鱼 | 来源:发表于2021-08-10 14:09 被阅读0次

ansible git模块

官方介绍

  • 用户名,密码方式clone指定分支
---
- hosts: localhost
  gather_facts: false
  vars:
    git_base: /tmp/codes/
    git_dir: "{{ git_base }}/product"
    branch: devel
  tasks:
    - name: clone product
      git:
        repo: https://username:password@gitlab.xxxx.com/product/product.git
        dest: "{{ git_dir }}"
        version: "{{ branch }}"
  • gitlab使用token下载代码
    进入仓库 settings 选择access tokens


    image.png

    记录好生成的token,替换URL

repo: https://oauth2:$token@gitlab.xxxx.com/product/product.git

相关文章

网友评论

      本文标题:ansible git模块

      本文链接:https://www.haomeiwen.com/subject/jjmxbltx.html