brutella / hkcam

Open-Source HomeKit Surveillance Camera
https://hochgatterer.me/hkcam/
Apache License 2.0
925 stars 141 forks source link

Ansible hangs on Task Gathering Facts #32

Closed svh1985 closed 2 years ago

svh1985 commented 5 years ago

Hi there,

The Ansible script hangs on my High Sierra Mac. I'm not seeing any errors. Not sure what is wrong. I have the latest Raspbian Lite image installed and running with SSH enabled on a RPi 2B.

This is the Ansible -vvvv output:

ansible-playbook 2.8.1
  config file = None
  configured module search path = ['/Users/stephan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.7.3 (default, Mar 27 2019, 09:23:39) [Clang 10.0.0 (clang-1000.11.45.5)]
No config file found; using defaults
SSH password:
setting up inventory plugins
host_list declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /Users/stephan/Developer/hkcam/ansible/hosts as it did not pass it's verify_file() method
Parsed /Users/stephan/Developer/hkcam/ansible/hosts inventory source with ini plugin
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/hkcam/tasks/install.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/hkcam/tasks/configure.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/install.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/add.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/enabled.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/envs.yml
statically imported: /Users/stephan/Developer/hkcam/ansible/roles/runit/tasks/state.yml
Loading callback plugin default of type stdout, v2.0 from /usr/local/Cellar/ansible/2.8.1/libexec/lib/python3.7/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: rpi.yml **************************************************************
Positional arguments: rpi.yml
verbosity: 4
ask_pass: True
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/Users/stephan/Developer/hkcam/ansible/hosts',)
forks: 5
1 plays in rpi.yml

PLAY [rpi] *********************************************************************

TASK [Gathering Facts] *********************************************************
task path: /Users/stephan/Developer/hkcam/ansible/rpi.yml:2
<raspberrypi.local> ESTABLISH SSH CONNECTION FOR USER: pi
<raspberrypi.local> SSH: EXEC sshpass -d43 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="pi"' -o ConnectTimeout=10 -o ControlPath=/Users/stephan/.ansible/cp/5fce5d2568 raspberrypi.local '/bin/sh -c '"'"'echo ~pi && sleep 0'"'"''

I have sshpass 1.06 installed:

sshpass -V
sshpass 1.06
(C) 2006-2011 Lingnu Open Source Consulting Ltd.
(C) 2015-2016 Shachar Shemesh
This program is free software, and can be distributed under the terms of the GPL
See the COPYING file for more information.

Using "assword" as the default password prompt indicator.
brutella commented 5 years ago

Can you ping your Raspberry Pi with ping raspberrypi.local?

svh1985 commented 5 years ago

I can ping the RPi yes :)

PING raspberrypi.local (172.16.0.32): 56 data bytes
64 bytes from 172.16.0.32: icmp_seq=0 ttl=64 time=30.367 ms
64 bytes from 172.16.0.32: icmp_seq=1 ttl=64 time=3.803 ms
64 bytes from 172.16.0.32: icmp_seq=2 ttl=64 time=3.668 ms
64 bytes from 172.16.0.32: icmp_seq=3 ttl=64 time=4.667 ms
64 bytes from 172.16.0.32: icmp_seq=4 ttl=64 time=8.500 ms
^C
--- raspberrypi.local ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 3.668/10.201/30.367/10.235 ms
joeycortez42 commented 3 years ago

Just tried running the playbook on a fresh install of Buster List 2020-08-20 and got a sshpass error during Task Gathering. I had to sudo apt install sshpass and then I was able to get passed TASK: Gathering Facts. But then it never proceeds past that.

Yes, I can ping raspberry.local too.

I don't see a mentioned of sshpass in code. Maybe it's missing from a list of prerequisites?

UPDATE: Yeah, something is broken about the playbook. FFMpeg and v4l2loopback didn't get install.

joeycortez42 commented 3 years ago

https://github.com/ansible/ansible/issues/16894#issuecomment-384545181

"Ansible doesn't support prompting for an SSH key passphrase, and hangs. After removing the passphrase from the key and trying again, the playbook runs."

Reran ssh-keygen and ssh-copy with no passphrase and it is running.