semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Semaphore does not pull git repositories with its name

Open afeefghannam89 opened this issue 3 years ago • 3 comments

Hello,

semaphore does not pull the git repository with its name, that is why the task in UI complaints about not founding the role.

I am using v2.8.53 semaphore

# pwd
/opt/semaphore
# tree
.
|-- inventory
|-- roles
|   `-- repository_1_1
|       |-- defaults
|       |   `-- main.yml
|       |-- handlers
|       |   `-- main.yml
|       |-- meta
|       |   `-- main.yml
|       |-- README.md
|       |-- tasks
|       |   `-- main.yml
|       |-- tests
|       |   |-- inventory
|       |   `-- test.yml
|       `-- vars
|           `-- main.yml
`-- test.yml

8 directories, 10 files
# semaphore version
v2.8.53
# cat config.json
.....
"dialect": "mysql",
 	"port": "",
 	"interface": "",
 	"tmp_path": "/opt/semaphore/roles",
.....
cat test.yml
---
- hosts: all
  remote_user: root
  become: true
  roles:
    - ansible_test

afeefghannam89 avatar Jun 16 '22 09:06 afeefghannam89

To me it looks like you are trying to reference a role (ansible_test) which your playbook does not have access to. The roles directory needs to be on the same level as the playbook you are running in the directory structure, and it needs to contain individual roles directories inside, see here,

AndrewSav avatar Jun 18 '22 05:06 AndrewSav

@AndrewSav @fiftin That is why I opened this Issue here. This is a bug, Semaphore does not build the individual role directory. He should clone the GitHub repository or Ansible role in a directory, which has the same repository name, exactly like what git clone command makes. See please the output of my tree command.

afeefghannam89 avatar Jun 24 '22 11:06 afeefghannam89

@afeefghannam89 I do not think it is supposed to work this way. You should follow the documented directory structure that I linked. If your "bug" is that the directory named "repository_1_1" - this is by design and worked as expected. You should have the correct structure inside your repo in the first place.

AndrewSav avatar Jun 24 '22 20:06 AndrewSav