Groups
Groups

How to pass the git credentails if we are calling the playbook from other repository

18 views
Skip to first unread message

srinu talari

unread,
Sep 21, 2023, 11:16:12 AM9/21/23
to Ansible Project
Hi All,

I have a playbook like below,
- name: Integrate snow & Ansible hosts: localhost 
  gather_facts: no
  tasks: 
     - debug: 
              msg: play1 
- name: Include a play after another play
  import_playbook: playbookA.yaml 
- name: Include a play after another play
  import_playbook: https://{{ gitlab_username }}:{{ gitlab_password }}@gitlab.appsintranet.net/cloud/artifactory-hub/ansible-awx-ee/-/blob/dev/Test-Dev/master.yaml

In the above playbook, we are importing playbook current repository, and after sucessfull ran of that we are importing another playbook which is present in some other repository.
Now correct me if i am wrong i have passed credentails of git like above for the other repository.
I have tried execute this playbook in ansible template. it is troughing error like this.

ERROR! Unable to retrieve file contents
Could not find or access '/runner/project/Test/https:/gitlab-secret:stgctnb...@gitlab.appsintranet.net/cloud/hub/ansible-awx-ee/-/blob/dev/Test-Dev/master.yaml' on the Ansible Controller.
If you are using a module and expect the file to exist on the remote, see the remote_src option

Kindly suggest me and help me resolve this issue.


Thanks 
Reply all
Reply to author
Forwar
Reply all
Reply to author
Forward
0 new messages
Search
Clear search
Close search
Google apps
Main menu