All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@kernel.org>
To: cel@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 11:13:27 +0200	[thread overview]
Message-ID: <23720f8e-6f0f-4107-a6d5-c7cc2b9a1bdc@kernel.org> (raw)
In-Reply-To: <20250518141838.176772-1-cel@kernel.org>

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?


> 
> 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?


  parent reply	other threads:[~2025-05-19  9:13 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 ` Daniel Gomez [this message]
2025-05-19 13:11   ` [PATCH v1 1/2] bootlinux: Modernize install-deps/main.yml Chuck Lever
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=23720f8e-6f0f-4107-a6d5-c7cc2b9a1bdc@kernel.org \
    --to=da.gomez@kernel.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.