geerlingguy / internet-pi

Raspberry Pi config for all things Internet.
MIT License
4.29k stars 448 forks source link

Can't complete setup #527

Closed oliverconstance closed 3 months ago

oliverconstance commented 1 year ago

I have followed the instructions in the readme.md file, but keep getting stuck at step 4. I have searched through Issues for the same error message but none appear to include a resolution.

:~/internet-pi $ ansible-playbook main.yml

[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.3 (default, Jun 29 2023, 18:03:57) [GCC 8.3.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. [WARNING]: Unable to parse /home/oliver/internet-pi/inventory.ini as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' [WARNING]: Could not match supplied host pattern, ignoring: internet_pi

PLAY [Configure Internet Pi.] *** skipping: no hosts matched

PLAY RECAP ** `

===============

I have tried the inventory as both of the below (where XXX is the actual IP address of my Pi. I am certain about the IP address because I SSH into it.

[internet_pi]

192.168.1.XXX ansible_user=pi

Comment out the previous line and uncomment this to run inside Raspberry Pi.

127.0.0.1 ansible_connection=local ansible_user=pi `


[internet_pi]

192.168.1.XXX ansible_user=pi

Comment out the previous line and uncomment this to run inside Raspberry Pi.

127.0.0.1 ansible_connection=local ansible_user=pi `

===============

Any guidance much appreciated, thank you

oliverconstance commented 1 year ago

This is a fresh installation of Raspberry Pi OS Lite, with nothing else on it

oliverconstance commented 1 year ago

Have tried uncommenting the first line and changing the ansible_user to the name of the local user (oliver) and same error message

jerzerisz commented 1 year ago

I think you're on the right track here, since Raspberry pi OS no longer has the default pi user, you do need to substitute oliver for pi. (this probably should be updated on documentation)

if you're running the ansible script on the pi you're installing to, try changing it in the following line:

127.0.0.1 ansible_connection=local ansible_user=pi should be changed to: 127.0.0.1 ansible_connection=local ansible_user=oliver

There should only be this line and the [internet-pi] lines uncommented.

oliverconstance commented 1 year ago

Thanks for the response. Yes tried that too and same error message sadly

jerzerisz commented 1 year ago

Then it might be a formatting or permissions issue.

My next step would be to delete the inventory.ini file, and re-copy/edit example.inventory.ini

Tried a couple different manglings of the inventory.ini file, but couldn't exactly replicate the error you got.

How are you coping/editing it?

oliverconstance commented 1 year ago

I am using the unix cp command to copy and create new file

I can attempt a fresh copy tomorrow evening when back at my PC. Given you mentioned potential permissions issue, should I also chmod It to something else

oliverconstance commented 1 year ago

(sorry miss click while trying to edit)

oliverconstance commented 1 year ago

I am copying with the unix cp command

As you say a possible permissions issue, should I attempt to chmod to something different?

I am using cat and vi to view and edit so assume not a formatting issue but happy to try again tomorrow evening when next at my pc

Thank you for trying to help

jerzerisz commented 1 year ago

Since you're using native *nix commands i'm less concerned about formatting, i was trying to eliminate some windows editing/copy scenario, and vi is for brave souls.

Just tested chmod/chown: chown root:root inventory.ini no change/error chmod 000 inventory.ini same 4 errors

clean config for me is: chown user:user inventory.ini chmod 644 inventory.ini

Actually all files and dirs are user:user all files are 644 and directories are 755

Hopefully this helps.

github-actions[bot] commented 10 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

danindiana commented 9 months ago

127.0.0.1 ansible_connection=local ansible_user=oliver

OK, this got it working for me. Making sure that the IP and User were correct. I think Jeff uses "localhost ansible_connection=local" which results in errors.

github-actions[bot] commented 5 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 3 months ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.