Re: [PATCH v2 09/15] bootlinux: fix os detection for 9p build dependency installation

Chuck Lever <[email protected]> Sat, 8 Nov 2025 15:56:31 -0500
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
On 11/8/25 3:12 PM, Daniel Gomez wrote:
>> The way I tried to deal with that was to use "delegate_to:". But I think
>> you might have advanced a different mechanism, and I missed the
>> subtleties of that. Or, maybe providing execution locale information on
>> the Ansible command line just isn't appropriate in these cases. I
>> haven't thought it through.
> This is where it gets tricky. I've just found out that delegated tasks to a
> host that is not included in the scope (such as localhost), do not have gathered
> facts.

This is surprising, but explains a lot. I didn't know this either!


> https://docs.ansible.com/ansible/latest/playbook_guide/
> playbooks_delegation.html#delegating-facts
> 
> That explains why ansible_os_family returns the guest fact (e.g. RedHat
> guest), not the localhost fact (e.g. Debian host) when we import_tasks:
> install-deps/main.yml in build/9p.yml.
> 
> The use of distro_yada_based in patch "bootlinux: fix os detection for 9p build
> dependency installation" allows to access the fact (os family) via Kconfig for
> the localhost. But breaks builder and targets sub-roles.
> 
>> I'm very happy to help drill into the 9p case that was not working for
>> you, instead of standing nearby lobbing uninformed suggestions.
>> Meanwhile, I'll keep a patch that reverts 0e9c8ac8bc68 in my private
>> tree.
>>
> Thanks Chuck. I think the correct approach is to revert patch 0e9c8ac8
> "bootlinux: fix os detection for 9p build dependency installation" upstream,
> while we try to sort this out in 9p.
> 
> For the revert part, please push:
> Acked-by: Daniel Gomez <[email protected]>
> 
> FYI, I'm already working on a solution using delegate_facts + hostvars as
> described in the Ansible documentation link above. That seems to be the right
> approach. I'll send something soon for testing.

For expediency, I had a patch that reverted just the install-deps/
main.yml hunk. Testing a full revert of 0e9c8ac8bc68 now, before
pushing.


-- 
Chuck Lever