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

Using collections from a private git repo fails. #8257

Closed
Emusp opened this issue Sep 29, 2020 · 1 comment
Closed

Using collections from a private git repo fails. #8257

Emusp opened this issue Sep 29, 2020 · 1 comment
Labels

Comments

@Emusp
Copy link

Emusp commented Sep 29, 2020

ISSUE TYPE
  • Bug Report
SUMMARY

I'm trying to get my playbook to use a collection from our company gitlab server.
Following the documentation on https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#installing-a-collection-from-a-git-repository

Created collections/requirements.yml file with.

---
collections:
  - name: git@<company_git_server>:<path_to_collection>.git
    type: git

When I try to sync the project in AWX, I get the following error.

ERROR! Invalid collection name 'git@<company_git_server>:<path_to_collection>.git', name must be in the format .. Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only.

For me, it seems that AWX just ignore the type: git in the requirements.yml file.

ENVIRONMENT
  • AWX version: 14.1.0
  • AWX install method: docker on linux
  • Ansible version: 2.9.11
  • Operating System: rhel7
  • Web Browser: Chrome
STEPS TO REPRODUCE

Point to a private git repo in the requirements.yml file.

EXPECTED RESULTS

Playbook imports the collections from the private git repo.

ACTUAL RESULTS

The the project sync, it fails at the task. [fetch galaxy collections from collections/requirements.yml]

ADDITIONAL INFORMATION
{
    "msg": "non-zero return code",
    "cmd": [
        "ansible-galaxy",
        "collection",
        "install",
        "-r",
        "collections/requirements.yml",
        "--collections-path",
        "/var/lib/awx/projects/.__awx_cache/_179__setup_iscsi_win/stage/requirements_collections"
    ],
    "stdout": "Process install dependency map\n|\b",
    "stderr": "ERROR! Invalid collection name 'git@<company_git_server>:<path_to_collection>.git', name must be in the format <namespace>.<collection>. Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only.",
    "rc": 1,
    "start": "2020-09-29 08:15:11.776072",
    "end": "2020-09-29 08:15:12.937766",
    "delta": "0:00:01.161694",
    "changed": false,
    "invocation": {
        "module_args": {
            "chdir": "/var/lib/awx/projects/_179__setup_iscsi_win",
            "_raw_params": "ansible-galaxy collection install -r collections/requirements.yml --collections-path /var/lib/awx/projects/.__awx_cache/_179__setup_iscsi_win/stage/requirements_collections \n",
            "warn": true,
            "_uses_shell": false,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "argv": null,
            "executable": null,
            "creates": null,
            "removes": null,
            "stdin": null
        }
    },
    "stdout_lines": [
        "Process install dependency map",
        "|\b"
    ],
    "stderr_lines": [
        "ERROR! Invalid collection name 'git@<company_git_server>:<path_to_collection>.git', name must be in the format <namespace>.<collection>. Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only."
    ],
    "_ansible_no_log": false
}

@AlanCoding
Copy link
Member

Ansible version: 2.9.11

Installing collections from git repos was introduced in Ansible 2.10 ansible/ansible#69154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants