Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve with given tag not working #265

Open
maxrainer opened this issue Oct 23, 2024 · 0 comments
Open

Retrieve with given tag not working #265

maxrainer opened this issue Oct 23, 2024 · 0 comments
Assignees

Comments

@maxrainer
Copy link

maxrainer commented Oct 23, 2024

SUMMARY

When running module retrieve with a TAG, the command that is executed seems to forget the URL of the repo.
Without the TAG everything seems to work fine.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.scm.retrieve

ANSIBLE VERSION
ansible [core 2.17.5]
  config file = /Users/mrainer/Documents/dev/ansible/networking/playbooks/avd/single-dc-l3ls-new/ansible.cfg
  configured module search path = ['/Users/mrainer/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/mrainer/venv/avd/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/mrainer/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/mrainer/venv/avd/bin/ansible
  python version = 3.11.7 (main, Dec  4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] (/Users/mrainer/venv/avd/bin/python3.11)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION

tested with 1.2.2, 2.0, 3.0
same result for all of them

Collection  Version
----------- -------
ansible.scm 3.0.0 
CONFIGURATION

OS / ENVIRONMENT

all OS

STEPS TO REPRODUCE
 - name: Pull Repo from SCM
      ansible.scm.git_retrieve:
        origin:
          url: "{{ git_url }}"
          token: "{{ git_token }}"
          tag: "oct22"
        parent_directory: "{{ git_dir }}"
        branch:
          name: "{{ git_branch }}"
          duplicate_detection: false
      register: _repo
      run_once: true
      check_mode: false
EXPECTED RESULTS

this is the command without a given TAG:

"command": "git -C ./tmp -c 'http.extraheader=AUTHORIZATION: basic <TOKEN>' clone --depth=1 --progress --no-single-branch https://github.com/maxrainer/ansible-avd-sot.git",
ACTUAL RESULTS

git -C ./tmp -c 'http.extraheader=AUTHORIZATION: basic ' clone --depth=1 --progress --branch oct22

fatal: [dc1-spine1]: FAILED! => {"branch_name": "", "branches": [], "changed": true, "msg": "Failed to clone repository: https://github.com/maxrainer/ansible-avd-sot.git", "name": "", "output": [{"command": "git -C ./tmp -c 'http.extraheader=AUTHORIZATION: basic <TOKEN>' clone --depth=1 --progress --branch oct22", "env": "", "return_code": 129, "stderr_lines": ["fatal: You must specify a repository to clone.",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants