public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v1 5/9] devconfig: Replace import_tasks with include_tasks
Date: Tue, 14 Jan 2025 15:03:44 -0500	[thread overview]
Message-ID: <20250114200348.1706018-6-cel@kernel.org> (raw)
In-Reply-To: <20250114200348.1706018-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

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 <chuck.lever@oracle.com>
---
 .../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' ]
-- 
2.47.1


  parent reply	other threads:[~2025-01-14 20:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 20:03 [PATCH v1 0/9] Random short subjects cel
2025-01-14 20:03 ` [PATCH v1 1/9] bringup: prevent the use of vagrant cel
2025-01-14 20:03 ` [PATCH v1 2/9] Remove defconfigs/nfsd cel
2025-01-14 20:03 ` [PATCH v1 3/9] terraform/aws: Clean up a few nits cel
2025-01-14 20:03 ` [PATCH v1 4/9] Clean up task messages cel
2025-01-14 20:03 ` cel [this message]
2025-01-28 13:03   ` [PATCH v1 5/9] devconfig: Replace import_tasks with include_tasks Daniel Gomez
2025-01-28 14:20     ` Chuck Lever
2025-01-28 14:40       ` Daniel Gomez
2025-01-28 14:43         ` Chuck Lever
2025-01-14 20:03 ` [PATCH v1 6/9] terraform/aws: Enable selection of a Fedora (40) AMI cel
2025-01-14 20:03 ` [PATCH v1 7/9] terraform/aws: Add a couple more instance types cel
2025-01-14 20:03 ` [PATCH v1 8/9] terraform/aws: Add support for m7a " cel
2025-01-14 20:03 ` [PATCH v1 9/9] terraform: Hoist aws_profile into the terraform Kconfig cel
2025-01-17 21:05 ` [PATCH v1 0/9] Random short subjects Luis Chamberlain

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=20250114200348.1706018-6-cel@kernel.org \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox