I am trying to create a playbook where I can check any branch just by changing a variable. The git section in the playbook:
- name: Clone repository
git:
repo: "{{ repo_url }}"
dest: /some_path
key_file: some_path_to_a_file
version: "{{ repo_tag }}"
force: yes
At first I used repo_tag = master, and it worked. Then I created a new branch called dev and tried with repo_tag = dev. It says that he cannot verify this tag. The problem is that the module does not retrieve data before performing the check.
What am I doing wrong in my game?
Edit: As a temporary workaround, I just delete the repository folder before cloning, but this forces the clone even when it is not needed.
source
share