Interactive password support for Ansible clone of Azure Repository

Your password must be in your repo link as below

--- 
- name: Clone repo playbook
  hosts: dev

  vars_prompt: 
    - name: "git_user" 
      prompt: "Enter your git username" 
      private: no
    - name: "git_password" 
      prompt: "Password for 'https://[email protected]'"
      private: yes 

  tasks:
  - name: Clone a repo 
    git:
      repo: https://{{ git_user | urlencode }}:{{ git_password | urlencode }}@dev.azure.com/OrganizationName/ProjectName/_git/RepositoryName
      dest: /src/RepositoryName

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top