美文网首页
Ansible Git 模块设置用户名密码

Ansible Git 模块设置用户名密码

作者: qizhen816 | 来源:发表于2021-07-26 14:55 被阅读0次

    How do I pass username and password while using Ansible Git module? - Stack Overflow

    ---
    - hosts: all 
      gather_facts: no
      become: yes
      tasks:
        - name: install git package
          apt:
            name: git
    
        - name: Get updated files from git repository 
          git: 
            repo: "https://{{ githubuser | urlencode }}:{{ githubpassword | urlencode }}@github.com/privrepo.git"
            dest: /tmp
    

    其中githubuser 和githubpassword 可以在配置里写好,也可以命令输入:ansible-playbook -i hosts github.yml -e "githubuser=arbabname" -e "githubpassword=xxxxxxx"

    相关文章

      网友评论

          本文标题:Ansible Git 模块设置用户名密码

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