semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

how to access playbook.yaml on localhost in semaphore using file://

Open alokispandey opened this issue 2 years ago • 6 comments

I am struggling with setting up pilot deployment run with semaphore. Semaphore is failing to access repository hosted on same system. I am trying to acess it using file:// protocal. root@localhost ~]# snap --version snap 2.55.3-1.el8 snapd 2.55.3-1.el8 series 16 almalinux 8.5 kernel 4.18.0-348.20.1.el8_5.x86_64 [root@localhost ~]# Semaphore: (v2.8.53) OS: redhat release 8.5

Test: Accessing local repo (on same node)

  • Created new repository locally
    o cd webserver.git/ o git init o cp -v ~/installapache.yaml o cp -v ~/installapache.yaml . o git add . o git commit -m 'Initial commit' o git remote add origin /opt/git-server/webserver.git o git push origin master Result.1: Git clone on VM ( successful) git clone /opt/git-server/webserver.git Cloning into 'webserver'... done.

Result2.2: Semaphore ( Failed) Setup: Name:AWX-local
URL:file:///opt/git-server/webserver.git Branch: master Access: none

ERROR: Task 20 added to queue 1:08:15 PM Preparing: 20 1:08:15 PM Prepare TaskRunner with template: webserver-localhost 1:08:15 PM Failed in finding static repository at /opt/git-server/webserver.git: stat /opt/git-server/webserver.git: no such file or directory

what could be the issue?

alokispandey avatar May 13 '22 07:05 alokispandey

Based on the output, you need to remove the trailing .git so that you use file:///opt/git-server/webserver, as file:///opt/git-server/webserver.git isn't the name of the directory you're asking Semaphore to copy into your execution environment.

jcmdln avatar May 17 '22 23:05 jcmdln

@jcmdln what to supply for "Branch" when option "URL file//" is used as we cannot left branch blank?

image

Besides:

  1. I have chaanged the URL as you suggested to file:///opt/RosettaGitLab/AwxPoc
 [root@nhtlinrepansi003 ~]# ls /opt/RosettaGitLab/AwxPoc
AnsiblePlaybook  README.md

  1. Absolute Path to Ansible .yaml file

[root@nhtlinrepansi003 ~]# ls /opt/RosettaGitLab/AwxPoc/AnsiblePlaybook/installapache.yaml
/opt/RosettaGitLab/AwxPoc/AnsiblePlaybook/installapache.yaml

  1. My repo difinition image

  2. My task definition. image

  3. Still Job is failing to access the installer file: image

  4. Out of same command from CLI:

[root@nhtlinrepansi003 ~]# stat /opt/RosettaGitLab/AwxPoc
  File: /opt/RosettaGitLab/AwxPoc
  Size: 58              Blocks: 0          IO Block: 4096   directory
Device: fd01h/64769d    Inode: 397097      Links: 4
Access: (0750/drwxr-x---)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-05-18 05:00:05.318306456 +0100
Modify: 2022-04-29 06:15:31.661725130 +0100
Change: 2022-04-29 06:15:31.661725130 +0100
 Birth: 2022-04-29 06:15:30.008714164 +0100

Not sure what i am doing wrong. Do you think accessing root owned files/dir is an issue for semaphore? if yes then what user i should use here?

alokispandey avatar May 18 '22 08:05 alokispandey

Hi, I have a same problem.

Regards

magicdrums avatar Jun 30 '22 22:06 magicdrums

So far I know, this is a bug without any tentative fix date.

Considering the delay in support, I switched to "rundeck" now.

On Fri, Jul 1, 2022 at 3:49 AM Victor Pereira Barahona < @.***> wrote:

Hi, I have a same problem.

Regards

— Reply to this email directly, view it on GitHub https://github.com/ansible-semaphore/semaphore/issues/931#issuecomment-1171732534, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV4EVJQWJ43MONSDAUG2S3VRYMQPANCNFSM5V2R2MFA . You are receiving this because you authored the thread.Message ID: @.***>

-- THANKS ALOK PANDEY

alokispandey avatar Jul 01 '22 15:07 alokispandey

@magicdrums @alokispandey Refer this, able to get the local git repo working.

https://jhdatabase.tistory.com/71

getvasanth avatar Aug 05 '22 03:08 getvasanth

I already moved to rundeck..but this seems to be a fix. Precisely the URL.. Thanks for sharing..! [image: image.png]

On Fri, Aug 5, 2022 at 8:50 AM getvasanth @.***> wrote:

Refer this, able to get the local git repo working.

https://jhdatabase.tistory.com/71

— Reply to this email directly, view it on GitHub https://github.com/ansible-semaphore/semaphore/issues/931#issuecomment-1205999124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV4EVIEW6PVMII4N2BBSMDVXSB67ANCNFSM5V2R2MFA . You are receiving this because you authored the thread.Message ID: @.***>

-- THANKS ALOK PANDEY

alokispandey avatar Aug 13 '22 09:08 alokispandey