From patchwork Tue Jan 14 20:03:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13939433 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 E660814A60C for ; Tue, 14 Jan 2025 20:03:53 +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=1736885034; cv=none; b=eIX1+ns2BLu4KS6cYtyZ8wLoMRZea7aw2+EJ1F8nQoS3GIk8b1AiTUQh32KwXq6w33L2Z6X7RktdMPGGvUB2fWbF4uTJrjsW6JaciqZbFOqfCKMroPtLXFqZvTBKTAsVW9/bZgJslOEjkkB5MD8JvTaXesK5mXLLWI1usp3uyQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736885034; c=relaxed/simple; bh=ttnU7AXsnKMZVvzV/CC2N6Gllo4rjda9hl3Qs3OlF3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nfj1gDsHQoIq+kkDxl09nvBR7+4xF0OK/QW+MpJiFvpVlUzkB9MpwokUSJeZmM6BsSfE1pU/5T7RzohjebBC4+AmUqcWyo0EGa3r+7jU3k2CIhwZtY2YQke1zNQ/I2yKNDyKdfUtRm+bphJAatOfXNYZp74MlUcYqvFHmLF0YjU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zn6WFGT/; 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="Zn6WFGT/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DF36C4CEE3; Tue, 14 Jan 2025 20:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736885033; bh=ttnU7AXsnKMZVvzV/CC2N6Gllo4rjda9hl3Qs3OlF3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zn6WFGT/XPmNvlTc/ObyTgM8r2tyfyF6ke3KEAxLuySZEuq6EI+Lqsn7nBiVdvryF XAVSBS+goltla9zDw0bX78j2llzJBuosqD5dUgwoyTDTXq/7u09O5nLI3bU0iC6aaS KaHATkKHdlwaiZoI1EtSXiWr7CB565NpiSpi1gKq6xboKFLjJfcx3d/1MWROsvNae3 mmzJbvzLw96j1g/VwvZAHloP1sLmHF/KYD7q2cZtc7YRNICC+GIr/1SON7lAjgBEMw Euai0E8SEln+RNlQFl9Zal8XKfSGReSa2q+bK6mBPpMinw+BmhUM3G0xrZDa1p2Sur u4iThFmtc9wXQ== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v1 5/9] devconfig: Replace import_tasks with include_tasks Date: Tue, 14 Jan 2025 15:03:44 -0500 Message-ID: <20250114200348.1706018-6-cel@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250114200348.1706018-1-cel@kernel.org> References: <20250114200348.1706018-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever On a fresh Fedora 40 system, under buildbot, the devconfig role fails: statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/main.yml statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml statically imported: /var/lib/buildbot/worker/renoir1/nfsd-fixes-nfsd-pynfs/build/playbooks/roles/devconfig/tasks/install-deps/suse/main.yml redirecting (type: modules) ansible.builtin.zypper to community.general.zypper ERROR! couldn't resolve module/action 'zypper'. This often indicates a misspelling, missing collection, or incorrect module path. It shouldn't care about zypper, that's a Suse thing. Somewhere the os_family sensing logic has gone hay-wire. Handle this by using dynamic include_task instead of static import_task, and restructure the os_family checking task in install-deps/main.yml. Signed-off-by: Chuck Lever --- .../devconfig/tasks/install-deps/main.yml | 22 ++++++++++--------- playbooks/roles/devconfig/tasks/main.yml | 8 +++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/playbooks/roles/devconfig/tasks/install-deps/main.yml b/playbooks/roles/devconfig/tasks/install-deps/main.yml index 7034ac2e8eee..bd5fa6d4becd 100644 --- a/playbooks/roles/devconfig/tasks/install-deps/main.yml +++ b/playbooks/roles/devconfig/tasks/install-deps/main.yml @@ -24,21 +24,23 @@ skip: true tags: vars -# tasks to setup up repos, register system if needed and install -# preferred devtools packages. -- name: Distribution specific setup - tags: vars_simple - import_tasks: debian/main.yml +- name: Debian-specific setup + ansible.builtin.include_tasks: debian/main.yml when: - - ansible_facts['os_family']|lower == 'debian' + - ansible_os_family == "Debian" - devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool -- import_tasks: suse/main.yml tags: vars_simple + +- name: SuSE-specific setup + ansible.builtin.include_tasks: suse/main.yml when: - - ansible_facts['os_family']|lower == 'suse' + - ansible_os_family == "Suse" - devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool -- import_tasks: redhat/main.yml tags: vars_simple + +- name: Red Hat-specific setup + ansible.builtin.include_tasks: redhat/main.yml when: - - ansible_facts['os_family']|lower == 'redhat' + - ansible_os_family == "RedHat" - devconfig_try_refresh_repos|bool or devconfig_try_install_kdevtools|bool or kdevops_cli_install|bool + tags: vars_simple diff --git a/playbooks/roles/devconfig/tasks/main.yml b/playbooks/roles/devconfig/tasks/main.yml index db96e9489c15..51b890375215 100644 --- a/playbooks/roles/devconfig/tasks/main.yml +++ b/playbooks/roles/devconfig/tasks/main.yml @@ -31,10 +31,10 @@ # Distro specific - name: Install dependencies - import_tasks: install-deps/main.yml + ansible.builtin.include_tasks: install-deps/main.yml - name: Configure custom repositories and install packages - import_tasks: config-custom-repos-and-packages/main.yml + ansible.builtin.include_tasks: config-custom-repos-and-packages/main.yml when: - ansible_facts['os_family']|lower == 'redhat' @@ -447,7 +447,7 @@ tags: [ 'console' ] - name: Update your boot GRUB file if necessary - import_tasks: update-grub/main.yml + ansible.builtin.include_tasks: update-grub/main.yml when: - grub2_config_file.stat.exists - devconfig_enable_console|bool @@ -637,7 +637,7 @@ tags: [ 'sysctl' ] - name: Rev the kernel to the latest distribution kotd - import_tasks: kotd-rev-kernel/main.yml + ansible.builtin.include_tasks: kotd-rev-kernel/main.yml when: - devconfig_enable_kotd|bool tags: [ 'kotd' ]