public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: da.gomez@kernel.org, kdevops@lists.linux.dev
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v1 1/2] bootlinux: Modernize install-deps/main.yml
Date: Mon, 19 May 2025 09:11:34 -0400	[thread overview]
Message-ID: <8685ab2b-7169-4818-afb5-e7eb6cc11beb@kernel.org> (raw)
In-Reply-To: <23720f8e-6f0f-4107-a6d5-c7cc2b9a1bdc@kernel.org>

On 5/19/25 5:13 AM, Daniel Gomez wrote:
> On 18/05/2025 16.18, cel@kernel.org wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> This subrole is run using include_tasks, but install-deps/main.yml
>> then imports the distribution-specific steps. It's better to avoid
>> mixing import_tasks and include_tasks.
> 
> I agree.
> 
> Ansible explains tag inheritance recommendation here:
> https://docs.ansible.com/ansible/latest/playbook_guide/
> playbooks_tags.html#tag-inheritance-for-includes-blocks-and-the-apply-
> keyword
> 
> Can you add that to the commit message?

Yes.


>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>>   .../bootlinux/tasks/install-deps/main.yml     | 21 ++++++++++++-------
>>   1 file changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/playbooks/roles/bootlinux/tasks/install-deps/main.yml b/
>> playbooks/roles/bootlinux/tasks/install-deps/main.yml
>> index c4c16d20509c..2931f9fe06e3 100644
>> --- a/playbooks/roles/bootlinux/tasks/install-deps/main.yml
>> +++ b/playbooks/roles/bootlinux/tasks/install-deps/main.yml
>> @@ -1,8 +1,15 @@
>>   ---
>> -- name: oscheck distribution ospecific setup
>> -  import_tasks: debian/main.yml
>> -  when: ansible_facts['os_family']|lower == 'debian'
>> -- import_tasks: suse/main.yml
>> -  when: ansible_facts['os_family']|lower == 'suse'
>> -- import_tasks: redhat/main.yml
>> -  when: ansible_facts['os_family']|lower == 'redhat'
>> +- name: Debian-specific setup
>> +  ansible.builtin.include_tasks: debian/main.yml
>> +  when:
>> +    - ansible_os_family == "Debian"
> 
> In general, I think Ansible import is preferred for simplicity. The
> include_tasks module forces us to be explicit with the tags at
> 'include_*' task and at every included task level. Here, no tags are
> applied but debian/main.yml uses the linux tag. So if the playbook is
> run without specifying a tag (i.e. through linux Makefile target), I
> believe the file will be included but no tasks will be executed. Is that
> correct?
> 

The "linux" tag is not set by any invocation of this role. I have a
patch that removes the tag completely. I can include that patch when
I repost.

I went back and forth about whether to stick with import_tasks or
change to include_tasks, and I can't remember why I went with
include_tasks. So right at the moment, I'm not stuck on either one or
the other.


-- 
Chuck Lever

  reply	other threads:[~2025-05-19 13:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-18 14:18 [PATCH v1 1/2] bootlinux: Modernize install-deps/main.yml cel
2025-05-18 14:18 ` [PATCH v1 2/2] bootlinux: Fold bootlinux-local into the bootlinux role cel
2025-05-19  9:32   ` Daniel Gomez
2025-05-19 13:15     ` Chuck Lever
2025-05-19 13:38       ` Daniel Gomez
2025-05-19 13:50         ` Chuck Lever
2025-05-19  9:13 ` [PATCH v1 1/2] bootlinux: Modernize install-deps/main.yml Daniel Gomez
2025-05-19 13:11   ` Chuck Lever [this message]
2025-05-19 13:51     ` 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=8685ab2b-7169-4818-afb5-e7eb6cc11beb@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@kernel.org \
    --cc=kdevops@lists.linux.dev \
    /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