0

I am trying to clone a git repo using git module. My below code perfectly works most of the time but fails when a password contains '#' character with it (My doubt it might fail with other charecter as well).

Please help me to find a way to escape special charecter in password.

---
host: 127.0.0.1
become: true
become_user: root

tasks:
  - name: clone git repo.
    git:
      repo: "{{userName}}:{{password | urlencode}}@x.x.x.x/scm/test.git"
      dest: /tmp/test
      version: master
      force: true
Shibankar
  • 806
  • 3
  • 16
  • 40

1 Answers1

0

Try defining the password within single quotes i.e

'{{ password }}'

Also if SSH cloning is an option my suggestion would be to switch to SSH

error404
  • 2,684
  • 2
  • 13
  • 21