public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>,
	Luis Chamberlain <mcgrof@kernel.org>
Cc: kdevops@lists.linux.dev, Daniel Gomez <da.gomez@samsung.com>
Subject: Re: [PATCH 09/14] bootlinux: fix os detection for 9p delegated tasks with registered facts
Date: Tue, 28 Oct 2025 20:53:54 +0100	[thread overview]
Message-ID: <a4071f77-1cb9-46ac-a35f-6126f4360159@kernel.org> (raw)
In-Reply-To: <a319eeb2-ba9e-4625-87b1-35a7fe7717da@oracle.com>

On 28/10/2025 19.51, Chuck Lever wrote:
> On 10/28/25 2:11 PM, Daniel Gomez wrote:
>> From: Daniel Gomez <da.gomez@samsung.com>
>>
>> When using 9P builds, the Linux kernel is built once on the control
>> host (delegate_to: localhost, run_once: true) and shared to all guests.
>> The dependency installation tasks reference ansible_os_family which
>> gets overwritten when gathering facts from localhost, causing the wrong
>> distribution's packages to be installed.
> 
> Just curious: Doesn't kdevops already have variables (eg, distro_debian)
> that contain this state?

You're spot on.

To be clear, I don't like this approach, but I couldn't "gather"
ansible_os_family from the localhost and use it directly. The reason is because
of the inventory scope we run this playbook on:

Example:

make linux
...
+ ansible-playbook --limit baseline:dev playbooks/bootlinux.yml \
'--extra-vars=target_linux_git=/mirror/linux.git target_linux_tree=linux \
target_linux_ref=v6.15...
==> [linux]
PLAY: BOOTLINUX
TASK: Gathering Facts [kci-18884852820-153-nvme]
⠀⠀✓ [kci-18884852820-153-nvme]
TASK: Import optional extra_args file [kci-18884852820-153-nvme]
⠀⠀✓ [kci-18884852820-153-nvme]
TASK: Select the .config file for building the test kernel [kci-18884852820-153-nvme]
⠀⠀✓ [kci-18884852820-153-nvme]
...

That is gathering facts for the baseline and dev groups. Adding localhost (or
all hosts) shouldn't work either, since we don't want the playbook to run on the
localhost (controller node), except for some specific tasks. My guess is that it
worked before because the guest and the localhost (controller node) happened to
match, but we weren't actually collecting the controller node's facts correctly.

That gets me thinking if we should run bootlinux.yml localhosts tasks first with
a tag (e.g. setup), then run bootlinux on baseline and dev. Or what do you think
would be the right approach? 


>> @@ -1,4 +1,22 @@
>>  ---
>> +- name: Gather facts from localhost for dependency installation
>> +  ansible.builtin.setup:
>> +    filter: "ansible_os_family,ansible_distribution"
>> +  delegate_to: localhost
>> +  register: localhost_facts
>> +  run_once: true
>> +
>> +- name: Set localhost OS facts for 9P build
>> +  ansible.builtin.set_fact:
>> +    localhost_os_family: "{{ localhost_facts.ansible_facts.ansible_os_family }}"
>> +    localhost_distribution: "{{ localhost_facts.ansible_facts.ansible_distribution }}"
>> +  delegate_to: localhost
>> +  run_once: true

  reply	other threads:[~2025-10-28 19:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 18:11 [PATCH 00/14] Fedora on Debian Daniel Gomez
2025-10-28 18:11 ` [PATCH 01/14] base_image: restore locales-all installation for Debian Trixie Daniel Gomez
2025-10-28 18:11 ` [PATCH 02/14] guestfs: fix Kconfig indentation style Daniel Gomez
2025-10-28 18:11 ` [PATCH 03/14] guestfs: remove unused bringup debug Kconfig options Daniel Gomez
2025-10-28 18:11 ` [PATCH 04/14] guestfs: fix spelling errors and Debian capitalization Daniel Gomez
2025-10-28 18:11 ` [PATCH 05/14] base_image: set selinux to permissive for fedora on debian hosts Daniel Gomez
2025-10-28 18:11 ` [PATCH 06/14] ansible_provisioning: fix help text indentation style Daniel Gomez
2025-10-28 18:11 ` [PATCH 07/14] devconfig: fix undefined custom repos/packages variables Daniel Gomez
2025-10-28 18:11 ` [PATCH 08/14] devconfig: fix Ansible boolean conditional for custom repos Daniel Gomez
2025-10-28 18:11 ` [PATCH 09/14] bootlinux: fix os detection for 9p delegated tasks with registered facts Daniel Gomez
2025-10-28 18:51   ` Chuck Lever
2025-10-28 19:53     ` Daniel Gomez [this message]
2025-10-28 19:57       ` Chuck Lever
2025-10-28 18:11 ` [PATCH 10/14] guestfs: generate dedora distribution-specific hostname prefixes Daniel Gomez
2025-10-28 18:11 ` [PATCH 11/14] defconfigs: add fedora-41 fragment for guestfs Daniel Gomez
2025-10-28 18:11 ` [PATCH 12/14] defconfigs: add debian-13 " Daniel Gomez
2025-10-28 18:11 ` [PATCH 13/14] github: add guest OS selection for CI testing Daniel Gomez
2025-10-28 18:11 ` [PATCH 14/14] guestfs: increase SSH config timeout for Fedora on Debian hosts 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=a4071f77-1cb9-46ac-a35f-6126f4360159@kernel.org \
    --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