Closed adamtomajko closed 1 year ago
I was able to run it! 🙌🏻
and for everyone with the same issues here me workaround.
I save inventory.ini
with inicial instruction (and commented localhost access)
# localhost ansible_connection=local
10.111.10.11 ansible_user=pi
Reboot Pi and issue was same 👇🏻
pi@rpi1:~/internet-pi $ ansible-playbook main.yml
PLAY [Configure Internet Pi.] ***************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
fatal: [10.111.10.11]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: pi@10.111.10.11: Permission denied (publickey,password).", "unreachable": true}
PLAY RECAP **********************************************************************************************************
10.111.10.11 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
then I try to use ssh password for it by ansible-playbook main.yml -k
but was given this 👇🏻
SSH password:
PLAY [Configure Internet Pi.] ***************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
PLAY RECAP **********************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
then I install sshpass initially by apt-get install sshpass
but was given 👇🏻
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
so I use sudo apt-get install sshpass
succesfully!
Then I use ansible-playbook main.yml -kK
Type 2 times ssh password and everything worked like a charm. 🙌🏻
I have done everything in documentation "README" and came to "ansible-playbook main.yml"
than i was given this response 👇🏻
I found similar issue here -> https://github.com/geerlingguy/internet-pi/issues/20
In inventory.ini, I change the line under
[internet_pi]
toread: localhost ansible_connection=local
but I was given different response as user in issue/20 response 👇🏻
Background of setup
Running Raspberry Pi 3 B+ (I know it is not recommended)
eth0 static ip 10.111.10.11
ssh enabled as
pi@rpi1.local
and alsopi@10.111.10.11
(I tried it from both)in config.yml i change only
and my objective is to run only Grafana so
pihole_enable: false
In beginning, I had issues with
ansible-galaxy collection install -r requirements.yml
ansible-galaxy: command not found
even after couple reboots nothing so I usepip3 install ansible
and copy whole ansible files to
internet-pi
*side note I am complete beginner and I had to google even simple linux commands :D