ansible-nas
ansible-nas copied to clipboard
Added raspberry pi support
What this PR does / why we need it: I noticed that using a raspberry pi as platform for this project would result in two issues:
- The geerlingguy.docker role won't work as it's not made for arm architecture
- Enabling universe repositories would fail every time
For these reasons I added the geerlingguy.docker_arm
role to the requirements of this project, and toggled the two versions (along with universe repositories enabling) through a x86_architecture
flag.
This setup has been tested multiple times on a Raspberry Pi 4 model B, but should work on any ARM controller running Ubuntu/Ubuntu server.
Lemme know if you need more details, sadly I only have one rpi and cannot test it against other models (won't disregard a raspberry pi care package for testing tho)
I just noticed my formatter (which automatically runs on file save) also putted double quotes on some strings, sorry about that!
Pi support is something I've had on my list to do for ages, I've actually got a pi somewhere that I manually hacked it on to...
However, I wonder if we could use ansible facts rather than expecting a user to set something manually. ansible_architecture
seems to contain the string we'd need to work with...
@davestephens much cleaner now, thanks for the tip! I started learning ansible with this project so there's a ton of stuff I'm still missing :)
Shouldn't all applications work without issues since they are virtualized services? I'm pretty sure docker is platform independent but if you have doubts I can do some reading to make sure
Docker isn't platform independent. It requires the image maintainer to support the platform you're pulling the image onto.
https://docs.docker.com/desktop/multi-arch/
Also, Docker isn't virtualization - it's containerisation of a running application - which is not the same thing :-)
In summary - the change you've made will work for images that have been built for arm64 too. If they haven't, the container will fail to start.
Sorry I'm used to interact with people that don't know docker and aren't interested in the details, and an easy first explanation that doesn't go too deep is that it virtualizes an application, thank you for the correction. I will make sure to mention that this project can't guarantee that every application will be available if the platform is not the standard x86_64
Is there any action needed to merge this change?
Hey all, I'm running a Pi 4 and keen to get this up and running. Happy to do some testing if necessary? Any further action needed here? :)
Happy to get more testing done, it should go without issues as I tested on a 4b myself, but you never know :)
Many thanks for this - I've picked parts of this PR in 791ff3e and removed parts that are no longer relevant.