From 663dfdf62bb2d1d7e1543796d8085f53a43ba818 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20M=C3=BCller?= <daniel.q.mueller@stud.h-da.de>
Date: Wed, 24 Nov 2021 18:53:27 +0000
Subject: [PATCH] Allow only 64-bit arm & python 3.9

- Fail by default if not running on aarch64 (arm 64-bit)
- Fail by default if python version is not 3.9.x
---
 README.md |  2 +-
 local.yml | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 66c9661..56bdfc2 100644
--- a/README.md
+++ b/README.md
@@ -44,5 +44,5 @@ This current version of the playbook will install a prebuilt `tensorflow-2.7` wh
 That means for now the playbook **only works on Raspberry Pi OS 11 64-bit**
 
 ### Updating the playbook for 32-bit Raspberry Pi OS
-Besides `tensorflow` all other dependencies will pretty much work regardless of architecture and python3 version. So to make this playbook work on 32-bit a decision must be made depending on the architecture. On 32-bit a different prebuilt `tensorflow` wheel must be used, as well as another `numpy` version.
+Besides `tensorflow` all other dependencies will pretty much work regardless of architecture and python3 version. So to make this playbook work on 32-bit a decision must be made depending on the architecture. On 32-bit a different prebuilt `tensorflow` wheel must be used, as well as another `numpy` version. No prebuilt wheels were found yet for 32-bit in combination with `python3.9` (debian / raspberry pi os 11), only for `python3.7` which is not compatible with the current version of raspberry pi os.
 
diff --git a/local.yml b/local.yml
index 52a6d83..ae4b697 100644
--- a/local.yml
+++ b/local.yml
@@ -4,12 +4,18 @@
     target_user: pi
     jupyter_service: true
     ignore_python_version: false 
+    ignore_architecture: faslse
 
   pre_tasks:
     - name: Check python version
       fail:
-        msg: Python version is not supported. Set ignore_python_version to true to ignore this.
-      when: (not ignore_python_version) and not (ansible_python_version is version('3.7.0', '>=') and ansible_python_version is version('3.10.0', '<'))
+        msg: "Python version is not supported. Expected 3.9.x . Set ignore_python_version to true to ignore this. Running on a different python version is not supported and will most likely not work."
+      when: (not ignore_python_version) and not (ansible_python_version is version('3.9.0', '>=') and ansible_python_version is version('3.10.0', '<'))
+    
+    - name: Check architecture
+      fail:
+        msg: "CPU Architecture not compatible. Expected aarch64 (arm 64-bit). Set ignore_architecture to true to ignore this. Running on a different architecture is not supported and will most likely not work."
+      when: not ignore_architecture and ansible_architecture != 'aarch64'
 
     - name: Update apt cache & install base requirements
       become: true
-- 
GitLab