Gilab-ci ansible-galaxy requirements

Hello guys !

I want to create new gitlab-ci with ansible / ansible-galaxy, but when i declare token to requirements.yml, gitlab send an error

$ ansible-galaxy role install --force -r requirements.yml -p roles/
[24](https://gitlab.domain.lan/user/ansible-base-advanced2/-/jobs/501#L24)[WARNING]: - chrony was NOT installed successfully: - scm [https://gitlab](https://gitlab/) is not
[25](https://gitlab.domain.lan/user/ansible-base-advanced2/-/jobs/501#L25)currently supported
[26](https://gitlab.domain.lan/user/ansible-base-advanced2/-/jobs/501#L26)ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
[28](https://gitlab.domain.lan/user/ansible-base-advanced2/-/jobs/501#L28)Cleaning up file based variables00:01
[30](https://gitlab.domain.lan/user/ansible-base-advanced2/-/jobs/501#L30)ERROR: Job failed: exit code 1

It is possible to use gitlab token with requirements.yml ?

- name: chrony
  scm: git
  src: "https://<Deploy Token username>:<Token PASS>@gitlab.domain.lan/ansible/chrony.git"
  version: "v1.0.0"

My chrony role as in private repository.

This command work fine in shell but not in requirements.yml!

 git clone https://gitlab+deploy-token-3:pPvR-----a27kycu@gitlab.domain.lan/ansible/chrony.git

Hi @rkistart
I wonder if the culprit isn’t the + sign in token username. Try to create one with custom username only using [a-z0-9]

Hi,

I find solution. :stuck_out_tongue_winking_eye:

It’s not possible for Ansible-galaxy to use authentication on requirements.yml. I create Deploy TOKEN and use this variables on my gitlab-ci.yml

  - git config --global credential.helper store
  - |
    git credential approve << EOF
    protocol=https
    host=gitlab.domain.lan
    username=$ANSIBLE_USER_CI_OOPS
    password=$ANSIBLE_PASSWORD_CI_OOPS
    EOF