public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@kernel.org>
To: Luis Chamberlain <mcgrof@kernel.org>,
	 Chuck Lever <chuck.lever@oracle.com>
Cc: kdevops@lists.linux.dev, Daniel Gomez <da.gomez@samsung.com>
Subject: [PATCH v2 09/15] bootlinux: fix os detection for 9p build dependency installation
Date: Wed, 29 Oct 2025 13:40:51 +0100	[thread overview]
Message-ID: <20251029-fedora-on-debian-v2-9-ddc6e5bebc15@samsung.com> (raw)
In-Reply-To: <20251029-fedora-on-debian-v2-0-ddc6e5bebc15@samsung.com>

From: Daniel Gomez <da.gomez@samsung.com>

Dependency installation for 9P builds was checking ansible_os_family,
which references the target guest's OS instead of the control host where
packages are actually installed. This caused incorrect packages to be
installed when building Fedora guests on Debian hosts.

Replace ansible_os_family checks with Kconfig distro variables
(distro_debian_based, distro_fedora, etc.) which correctly detect
the control host's distribution. Add fallback defaults to ensure the
variables are always defined for standalone role usage.

Generated-by: Claude AI
Suggested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 playbooks/roles/bootlinux/defaults/main.yml                  | 6 ++++++
 playbooks/roles/bootlinux/tasks/build/9p.yml                 | 2 +-
 playbooks/roles/bootlinux/tasks/install-deps/main.yml        | 6 +++---
 playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml | 4 ++--
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/playbooks/roles/bootlinux/defaults/main.yml b/playbooks/roles/bootlinux/defaults/main.yml
index 1ae70b2c..78e4e28f 100644
--- a/playbooks/roles/bootlinux/defaults/main.yml
+++ b/playbooks/roles/bootlinux/defaults/main.yml
@@ -141,3 +141,9 @@ bootlinux_fragment_x86: false
 bootlinux_fragment_xarray: false
 bootlinux_fragment_xarray_no_multi: false
 
+
+# Distro controls
+distro_debian_based: false
+distro_fedora: false
+distro_redhat_based: false
+distro_suse_based: false
diff --git a/playbooks/roles/bootlinux/tasks/build/9p.yml b/playbooks/roles/bootlinux/tasks/build/9p.yml
index f390f028..809d342a 100644
--- a/playbooks/roles/bootlinux/tasks/build/9p.yml
+++ b/playbooks/roles/bootlinux/tasks/build/9p.yml
@@ -14,7 +14,7 @@
   when:
     - target_linux_install_b4 is defined
     - target_linux_install_b4
-    - ansible_facts['os_family']|lower != 'debian'
+    - not distro_debian_based|bool
   run_once: true
   delegate_to: localhost
 
diff --git a/playbooks/roles/bootlinux/tasks/install-deps/main.yml b/playbooks/roles/bootlinux/tasks/install-deps/main.yml
index 51a20741..058f3926 100644
--- a/playbooks/roles/bootlinux/tasks/install-deps/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-deps/main.yml
@@ -2,14 +2,14 @@
 - name: Debian-specific setup
   ansible.builtin.import_tasks: debian/main.yml
   when:
-    - ansible_os_family == "Debian"
+    - distro_debian_based|bool
 
 - name: SuSE-specific setup
   ansible.builtin.import_tasks: suse/main.yml
   when:
-    - ansible_os_family == "Suse"
+    - distro_suse_based|bool
 
 - name: Red Hat-specific setup
   ansible.builtin.import_tasks: redhat/main.yml
   when:
-    - ansible_os_family == "RedHat"
+    - distro_redhat_based|bool
diff --git a/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml b/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
index 7f1955bf..e9a0c6e2 100644
--- a/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/bootlinux/tasks/install-deps/redhat/main.yml
@@ -3,7 +3,7 @@
   ansible.builtin.include_role:
     name: epel-release
   when:
-    - ansible_distribution != "Fedora"
+    - not distro_fedora|bool
 
 - name: Install packages we care about
   become: true
@@ -67,7 +67,7 @@
   vars:
     packages:
       - btrfs-progs
-  when: ansible_distribution == 'Fedora'
+  when: distro_fedora|bool
 
 - name: Install clang
   become: true

-- 
2.51.0


  parent reply	other threads:[~2025-10-29 12:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 12:40 [PATCH v2 00/15] Fedora on Debian Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 01/15] base_image: restore locales-all installation for Debian Trixie Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 02/15] guestfs: fix Kconfig indentation style Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 03/15] guestfs: remove unused bringup debug Kconfig options Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 04/15] guestfs: fix spelling errors and Debian capitalization Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 05/15] base_image: set selinux to permissive for fedora on debian hosts Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 06/15] ansible_provisioning: fix help text indentation style Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 07/15] devconfig: fix undefined custom repos/packages variables Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 08/15] devconfig: fix Ansible boolean conditional for custom repos Daniel Gomez
2025-10-29 12:40 ` Daniel Gomez [this message]
2025-11-07 19:22   ` [PATCH v2 09/15] bootlinux: fix os detection for 9p build dependency installation Chuck Lever
2025-11-07 20:00     ` Daniel Gomez
2025-11-07 20:17       ` Chuck Lever
2025-11-07 20:47         ` Daniel Gomez
2025-11-07 20:53           ` Chuck Lever
2025-11-07 23:20             ` Daniel Gomez
2025-11-07 23:24               ` Daniel Gomez
2025-11-08 16:11               ` Chuck Lever
2025-11-08 20:12                 ` Daniel Gomez
2025-11-08 20:56                   ` Chuck Lever
2025-10-29 12:40 ` [PATCH v2 10/15] selftests: " Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 11/15] guestfs: generate fedora distribution-specific hostname prefixes Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 12/15] defconfigs: add fedora-41 fragment for guestfs Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 13/15] defconfigs: add debian-13 " Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 14/15] github: add guest OS selection for CI testing Daniel Gomez
2025-10-29 12:40 ` [PATCH v2 15/15] guestfs: increase SSH config timeout for Fedora on Debian hosts Daniel Gomez
2025-10-29 13:49 ` [PATCH v2 00/15] Fedora on Debian Chuck Lever
2025-10-29 14:16 ` Daniel Gomez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251029-fedora-on-debian-v2-9-ddc6e5bebc15@samsung.com \
    --to=da.gomez@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@samsung.com \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox