From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3BC0269B02 for ; Mon, 19 May 2025 09:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747646010; cv=none; b=YL6gPPFig/nkPbWs12XttUi8+BvjWM0G8clF50unVNyj/UHOVGOkDXM71yx+FFwa5puDZr+SHiLD0RlNNr+DlU4bCTSS/wMtyQR11FqufFLpxwvRVGBXyOKhAl8UnAbuo/V16z1xOxOD5obLLUDQxFT5iCcsGpZcbPCcQVgeoXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747646010; c=relaxed/simple; bh=AfKXfnJEkOd1ME3RCXqcJr1cAguVuV5bJ6sDpzyWROw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bYZcHgBZ0VTRlp0MoWCVbb77uOh9DGlz0GrtaTnTTYnxh5ciIQomrFNhnhY8CSE8P83XF9o4BHCwyDJ1Zz1x78m/zaaglxokRnauXVI8TXWK3E+It0EhstGfHLbsQpKpnSFsnSoOmUsMQGn4lsG6vS/J0M6PfDcddV1reo+VdAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TA3PqBHZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TA3PqBHZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73703C4CEE4; Mon, 19 May 2025 09:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747646010; bh=AfKXfnJEkOd1ME3RCXqcJr1cAguVuV5bJ6sDpzyWROw=; h=Date:Subject:To:Cc:References:From:Reply-To:In-Reply-To:From; b=TA3PqBHZ7THPnZXV78NwUhvfnU8MJC9jr/AvFzdy3xuXDcdVhPErkgFfjUYiNk9tD Sgc02cWpvXJ/3Dk0vP8pfizhYzP5pEro7x9cq55nvE7LpACf2iM4YJexnLo3P2Onxn Zv3Ud7X/qCkfQIUiqpatPskoBPHsRDpi6Ua+dLKjMPVZi80gPOK8+0rPuUpXk/+Ggs WVXWwTeSetlqw6jfNIS6QFgV0P41dMF1izKuaB75f0xaahREc9PGhz/IoWCWmN382s snqphQFETx17TSs+SD+TblM1XHp9GqKDZmfuAMzUatIw50dXwfhLvsBUMqMgde+WoZ HOfvrL0UFM0Ew== Message-ID: <23720f8e-6f0f-4107-a6d5-c7cc2b9a1bdc@kernel.org> Date: Mon, 19 May 2025 11:13:27 +0200 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] bootlinux: Modernize install-deps/main.yml To: cel@kernel.org, kdevops@lists.linux.dev Cc: Chuck Lever References: <20250518141838.176772-1-cel@kernel.org> Content-Language: en-US From: Daniel Gomez Reply-To: da.gomez@kernel.org Organization: kernel.org In-Reply-To: <20250518141838.176772-1-cel@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 18/05/2025 16.18, cel@kernel.org wrote: > From: Chuck Lever > > 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 > --- > .../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?