I am just diving into hosting custom made roles in a private gitlab git repository.
The answer to this may just be "you must have only 1 repo for 1 role," which I have not done. I have tried to put two roles in a repo and have just used folders to differentiate them at the top level.
I seem to have gotten the "requirements.yml" written correctly, as it pulled my roles. However it is putting all the files from 'nexus' into my skeleton role of 'chocolatey_factory'. The 'nexus' imported role comes across fine.
My requirements file is the following:
---
- src: git+ssh://git@[local_ip_address]/gitlab-instance-937dde58/my_first_project.git
scm: git
version: main
name: nexus
- src: git+ssh://git@[local_ip_address]/gitlab-instance-937dde58/my_first_project.git
scm: git
version: main
name: chocolatey_factory
Here is my repo layout. The idea is I would have each folder at the top level of the repo be a role. So in this case, I have two roles.
chocolatey_factory galaxy init folder
What am I doing wrong here?
One is 'nexus,' the other is 'chocolatey_factory'. Nexus is the public role available for configuring Sontaype nexus that I grabbed. Chocolatey_factory is one I am making, but it is just a ansible-galaxy init skeleton at this time:
I then run my ansible-galaxy command
ansible-galaxy install -r roles/requirements.yml -p roles/
It imports the roles. But the files from 'nexus' role appear in the 'chocolatey_factory' role.
The 'nexus' role has files like pom.xml, where the 'chocolatey_factory' does not have anything other than what ansible-galaxy init creates (ie it does not have a pom.xml file).
You can see here both folders have all the same files.
ls roles
chocolatey_factory nexus requirements.yml
ls roles/chocolatey_factory
chocolatey_factory filter_plugins molecule tasks
CODE_OF_CONDUCT.md handlers pom.xml templates
defaults LICENSE.md README.md tests
files meta requirements.txt vars
ls roles/nexus
chocolatey_factory filter_plugins molecule tasks
CODE_OF_CONDUCT.md handlers pom.xml templates
defaults LICENSE.md README.md tests
files meta requirements.txt vars
Why are my files from one role being inserted into the other? Can you not have two roles in the same git repository?