From cc504e34161f954331f499082ec6f5950dfc7e27 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 30 Mar 2023 17:52:17 -0500 Subject: [PATCH 1/6] record dpkg --print-architecture --- roles/0-init/tasks/create_iiab_ini.yml | 2 ++ roles/0-init/tasks/main.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index 239ce570d..b4cc742ec 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -43,3 +43,5 @@ value: "{{ rpi_model }}" - option: devicetree_model value: "{{ devicetree_model }}" + - option: dpkg_arch + value: "{{ dpkg_arch }}" diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 4c02c6ca5..d4283dcf7 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -15,6 +15,7 @@ os_ver: "{{ ansible_local.local_facts.os_ver }}" python_version: "{{ ansible_local.local_facts.python_version }}" php_version: "{{ ansible_local.local_facts.php_version }}" + dpkg_arch: "{{ ansible_local.local_facts.dpkg_arch }}" # Initialize /etc/iiab/iiab.ini writing the 'location' and 'version' sections # once and only once, to preserve the install date and git hash. From 4eca25a1f7907fd10dc5196e07ea2d325ef9658b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 31 Mar 2023 15:55:27 -0500 Subject: [PATCH 2/6] drop local_facts --- roles/0-init/tasks/create_iiab_ini.yml | 6 +++++- roles/0-init/tasks/main.yml | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index b4cc742ec..5e5920545 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -4,6 +4,10 @@ path: "{{ iiab_ini_file }}" state: touch +- name: Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_archicture ~= ansible_machine is NOT enough!) + command: dpkg --print-architecture + register: dpkg_arch + - name: Add 'location' variable values to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" @@ -44,4 +48,4 @@ - option: devicetree_model value: "{{ devicetree_model }}" - option: dpkg_arch - value: "{{ dpkg_arch }}" + value: "{{ dpkg_arch.stdout }}" diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index d4283dcf7..4c02c6ca5 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -15,7 +15,6 @@ os_ver: "{{ ansible_local.local_facts.os_ver }}" python_version: "{{ ansible_local.local_facts.python_version }}" php_version: "{{ ansible_local.local_facts.php_version }}" - dpkg_arch: "{{ ansible_local.local_facts.dpkg_arch }}" # Initialize /etc/iiab/iiab.ini writing the 'location' and 'version' sections # once and only once, to preserve the install date and git hash. From 902e377c6810aef43bf0c5128a1a5e6292780efa Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 31 Mar 2023 22:57:36 -0400 Subject: [PATCH 3/6] create_iiab_ini.yml: dpkg_foreign_arch, clarifs, typos --- roles/0-init/tasks/create_iiab_ini.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index 5e5920545..e9b07e9a3 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -4,14 +4,18 @@ path: "{{ iiab_ini_file }}" state: touch -- name: Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_archicture ~= ansible_machine is NOT enough!) +- name: Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_architecture ~= ansible_machine is NOT enough!) command: dpkg --print-architecture register: dpkg_arch +- name: Run command 'dpkg --print-foreign-architectures' (secondary OS arch, if available) + command: dpkg --print-foreign-architectures + register: dpkg_foreign_arch + - name: Add 'location' variable values to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" - section: location + section: initial-location option: "{{ item.option }}" value: "{{ item.value | string }}" with_items: @@ -23,7 +27,7 @@ - name: Add 'version' variable values to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" - section: version + section: initial-version option: "{{ item.option }}" value: "{{ item.value | string }}" with_items: @@ -31,6 +35,10 @@ value: "{{ ansible_distribution }}" - option: arch value: "{{ ansible_architecture }}" + - option: dpkg_arch + value: "{{ dpkg_arch.stdout }}" + - option: dpkg_foreign_arch + value: "{{ dpkg_foreign_arch.stdout }}" - option: iiab_base_ver value: "{{ iiab_base_ver }}" - option: iiab_remote_url @@ -47,5 +55,3 @@ value: "{{ rpi_model }}" - option: devicetree_model value: "{{ devicetree_model }}" - - option: dpkg_arch - value: "{{ dpkg_arch.stdout }}" From f46c7d15551f58509600530be2a9c08bf2ec5dd2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 31 Mar 2023 22:59:42 -0400 Subject: [PATCH 4/6] mongodb/tasks/main.yml: Fix 'ansible_architecture' typo --- roles/mongodb/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index c755780d3..aab67fc0f 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -37,7 +37,7 @@ - debug: var: mongodb_version -- name: Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_archicture ~= ansible_machine is NOT enough!) +- name: Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_architecture ~= ansible_machine is NOT enough!) command: dpkg --print-architecture register: dpkg_arch - debug: From c69d6ef96c24fc3d1606c560339731cce49eedde Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 31 Mar 2023 23:30:51 -0400 Subject: [PATCH 5/6] create_iiab_ini.yml: Try {{ os_ver }} alongside redundant/failsafe {{ ansible_facts['distribution'] }} --- roles/0-init/tasks/create_iiab_ini.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index e9b07e9a3..f6cf612f7 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -31,8 +31,10 @@ option: "{{ item.option }}" value: "{{ item.value | string }}" with_items: + - option: os_ver + value: "{{ os_ver }}" - option: distribution - value: "{{ ansible_distribution }}" + value: "{{ ansible_facts['distribution'] }}" - option: arch value: "{{ ansible_architecture }}" - option: dpkg_arch From 4a32ba0375126e509d0200af850c6899183f827e Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 31 Mar 2023 23:39:21 -0400 Subject: [PATCH 6/6] create_iiab_ini.yml: Raise rpi_model & devicetree_model --- roles/0-init/tasks/create_iiab_ini.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index f6cf612f7..980a7fc1b 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -41,6 +41,10 @@ value: "{{ dpkg_arch.stdout }}" - option: dpkg_foreign_arch value: "{{ dpkg_foreign_arch.stdout }}" + - option: rpi_model + value: "{{ rpi_model }}" + - option: devicetree_model + value: "{{ devicetree_model }}" - option: iiab_base_ver value: "{{ iiab_base_ver }}" - option: iiab_remote_url @@ -53,7 +57,3 @@ value: "{{ ansible_local.local_facts.iiab_recent_tag }}" - option: install_date value: "{{ ansible_date_time.iso8601 }}" - - option: rpi_model - value: "{{ rpi_model }}" - - option: devicetree_model - value: "{{ devicetree_model }}"