semaphore: Listing playbook hosts failed

I have installed and setup Semaphore on Debian 10 using Snap as per the instructions but whenever I try and run a playbook it fails with the following error:

...
Failed to add the host to the list of known hosts (/root/.ssh/known_hosts).
...
installing static inventory
No roles/requirements.yml file found. Skip galaxy install process.
Listing playbook hosts failed: fork/exec /root/snap/semaphore/common/ansible_env/bin/ansible-playbook: no such file or directory

The file /root/snap/semaphore/common/ansible_env/bin/ansible-playbook does indeed exist and is executable.

Any ideas of what the problem could be?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 28 (1 by maintainers)

Most upvoted comments

@andavas Fixed. Please update semaphore by command:

sudo snap refresh semaphore

@Driaan I switched to using rundeck. it has an Ansible plugin and runs great. Using your system Ansible install etc and I just love it. would recommend

I’m getting a similar error:

1:26:50 AM
Started: 2147483645
1:26:50 AM
Run TaskRunner with template: ansible ping
1:26:50 AM
Preparing: 2147483645
1:26:50 AM
Cloning Repository file:///home/userxyz/templates/
1:26:50 AM
Unable to clone repository: exec: "git": executable file not found in $PATH
1:26:50 AM
Failed updating repository: exec: "git": executable file not found in $PATH
1:26:50 AM
Running playbook failed: exec: "git": executable file not found in $PATH

I am running in pve > lxc > ubuntu 22.04. Installed through snapd, nothing else done to the system apart from creating a new user and adjusting ssh options

i have the same issue with exit status 1 no further description… standalone install using static or file host no difference

12:17:25 PM installing static inventory 12:17:25 PM No roles/requirements.yml file found. Skip galaxy install process. 12:17:26 PM Listing playbook hosts failed: exit status 1

Any ideas?

did you solved it? having the exact same issue and also using no snap but “normal” installation of semaphore… its really hard to debug as I cannot find any useful logs or output anywhere…

EDIT: found the actual reason for my issue and created a ticket at #890 as the above is really just a generic hint which can’t be fixed without using the CLI to see the real error.

Sorry for delay.

@Vitexus , problem solved?

i have the same issue with exit status 1 no further description… standalone install using static or file host no difference

12:17:25 PM installing static inventory 12:17:25 PM No roles/requirements.yml file found. Skip galaxy install process. 12:17:26 PM Listing playbook hosts failed: exit status 1

Any ideas?

it even works with the bundled version of Ansible… just not in the web ui

/root/snap/semaphore/common/ansible_env/bin/ansible-playbook -i inventory_2147483572 --step -e "ansible_user=pi ansible_ssh_pass=<password>" repository_2_7/setup-ssh-tunneling.yml

I have exactly the same problem as @Vitexus … I suspect this is somehow an Ansible error, but I don’t know how to debug that

@fiftin Thanks for your work in resolving this. This problem appears to be resolved but Ansible is still outputting some warnings:

SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/root/snap/semaphore/common/repositories/access_key_2"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/snap/semaphore/common/repositories/.ansible/cp/a613b48526 '[]'
[WARNING]: sftp transfer mechanism failed on []. Use ANSIBLE_DEBUG=1 to see detailed information
SSH: EXEC scp -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/root/snap/semaphore/common/repositories/access_key_2"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/snap/semaphore/common/repositories/.ansible/cp/a613b48526 /tmp/ansible-local-28967zeal879n/tmp94s5qpv8 '[]:/root/.ansible/tmp/ansible-tmp-1631499481.9691327-29114-73458269705017/AnsiballZ_command.py'
[WARNING]: scp transfer mechanism failed on []. Use ANSIBLE_DEBUG=1 to see detailed information
ESTABLISH SSH CONNECTION FOR USER: root
SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/root/snap/semaphore/common/repositories/access_key_2"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/snap/semaphore/common/repositories/.ansible/cp/a613b48526  'dd of=/root/.ansible/tmp/ansible-tmp-1631499481.9691327-29114-73458269705017/AnsiballZ_command.py bs=65536'

It still appears to work fine but it does output those warnings.

It works! Well, kind of… I’m having some connection issues with SSH keys, but I believe this is somehow my fault. This time the task ran (with https key) before Ansible returning the error code 4 (unreachable).

I have the same issue, but when I updated the snap version and run the task again, I faced the following error:

Task # added to queue

Prepare task with template: Test 1

Updating repository <repo acess>

From <repo name>

* branch master -> FETCH_HEAD

Already up to date.

installing static inventory

No roles/requirements.yml file found. Skip galaxy install process. 

Listing playbook hosts failed: exit status 1 Traceback (most recent call last): File "/root/snap/semaphore/common/ansible_env/bin/ansible-playbook", line 63,
in <module> import ansible.constants as C File "/root/snap/semaphore/common/ansible_env/lib/python3.6/site-packages/ansible/constants.py", line 181,
in <module> config = ConfigManager() File "/root/snap/semaphore/common/ansible_env/lib/python3.6/site-packages/ansible/config/manager.py", line 307,
in __init__ self._parse_config_file() File "/root/snap/semaphore/common/ansible_env/lib/python3.6/site-packages/ansible/config/manager.py", line 336,
in _parse_config_file with open(to_bytes(cfile), 'rb') as f: PermissionError: [Errno 13] Permission denied: b'/etc/ansible/ansible.cfg' 

I did a complete reinstall of the server, now I am getting:

Listing playbook hosts failed: exec: "ansible-playbook": executable file not found in $PATH

So I installed Ansible, however I still get the same problem but note:

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

whereis ansible-playbook
ansible-playbook: /usr/local/bin/ansible-playbook