From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH 19/40] bootlinux: Relocate tasks that select a kernel .config
Date: Sun, 27 Jul 2025 17:17:38 -0700 [thread overview]
Message-ID: <20250728001800.3188617-20-mcgrof@kernel.org> (raw)
In-Reply-To: <20250728001800.3188617-1-mcgrof@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
Move the tasks that select the kernel .config to build into a
subrole. A dynamic "include_tasks" is used so that eventually these
tasks can be completely skipped when the bootlinux playbook is asked
only to install kernel packages.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
playbooks/roles/bootlinux/tasks/config.yml | 89 +++++++++++++++++++++
playbooks/roles/bootlinux/tasks/main.yml | 91 +---------------------
2 files changed, 92 insertions(+), 88 deletions(-)
create mode 100644 playbooks/roles/bootlinux/tasks/config.yml
diff --git a/playbooks/roles/bootlinux/tasks/config.yml b/playbooks/roles/bootlinux/tasks/config.yml
new file mode 100644
index 00000000..5cf03e7f
--- /dev/null
+++ b/playbooks/roles/bootlinux/tasks/config.yml
@@ -0,0 +1,89 @@
+---
+- name: Check whether config-kdevops exists
+ stat:
+ path: "{{ role_path }}/templates/config-kdevops"
+ register: config_kdevops
+ delegate_to: localhost
+
+- name: Found config-kdevops, using it for template
+ set_fact:
+ linux_config: "config-kdevops"
+ when: config_kdevops.stat.exists
+
+- name: No config-kdevops, looking for {{ target_linux_config }}
+ set_fact:
+ linux_config: "{{ target_linux_config }}"
+ when: not config_kdevops.stat.exists
+
+- name: Check if specific kernel config exists for {{ target_linux_ref }}
+ stat:
+ path: "{{ role_path }}/templates/{{ target_linux_config }}"
+ register: kernel_config
+ delegate_to: localhost
+
+- name: Find all linux-next configs if a your custom config-kdevops and ref config was not found
+ find:
+ paths: "{{ role_path }}/templates"
+ patterns: "config-next*"
+ file_type: file
+ recurse: no
+ register: found_configs
+ delegate_to: localhost
+ when:
+ - not config_kdevops.stat.exists
+ - not kernel_config.stat.exists
+
+- name: Extract the date from the filenames
+ set_fact:
+ configs_with_dates: "{{ configs_with_dates | default([]) + [{'file': item.path, 'date': (item.path | regex_search('config-next-(\\d{8})')).split('-')[-1]}] }}"
+ loop: "{{ found_configs.files }}"
+ when:
+ - not config_kdevops.stat.exists
+ - not kernel_config.stat.exists
+ - item.path is search('config-next-(\\d{8})')
+ no_log: true
+ delegate_to: localhost
+
+- name: Sort configs based on date extracted from filename
+ set_fact:
+ sorted_configs: "{{ configs_with_dates | selectattr('date', 'defined') | sort(attribute='date', reverse=True) | map(attribute='file') | list }}"
+ when:
+ - not config_kdevops.stat.exists
+ - not kernel_config.stat.exists
+ - configs_with_dates | length > 0
+ delegate_to: localhost
+
+- name: Set latest linux-next config if configs are found
+ set_fact:
+ latest_linux_next_config: "{{ sorted_configs[0] }}"
+ when:
+ - not config_kdevops.stat.exists and not kernel_config.stat.exists
+ - sorted_configs | length > 0
+ delegate_to: localhost
+
+- name: Use the specific kernel config or fallback to the latest linux-next
+ set_fact:
+ linux_config: "{{ target_linux_config | default('') if kernel_config.stat.exists else (latest_linux_next_config | default('') | basename) }}"
+ when:
+ - not config_kdevops.stat.exists
+ - not kernel_config.stat.exists
+ - latest_linux_next_config is defined
+ delegate_to: localhost
+
+- name: Verify config used
+ debug:
+ msg: "Linux config used: {{ role_path }}/templates/{{ linux_config }}"
+ delegate_to: localhost
+
+- name: Verify that the Linux configuration file exists
+ stat:
+ path: "{{ role_path }}/templates/{{ linux_config }}"
+ register: config_stat
+ delegate_to: localhost
+ when: linux_config is defined
+
+- name: Fail if the configuration file does not exist
+ fail:
+ msg: "The configuration file {{ role_path }}/templates/{{ linux_config }} does not exist."
+ when: not config_stat.stat.exists
+ delegate_to: localhost
diff --git a/playbooks/roles/bootlinux/tasks/main.yml b/playbooks/roles/bootlinux/tasks/main.yml
index 7671389c..9c43c1e5 100644
--- a/playbooks/roles/bootlinux/tasks/main.yml
+++ b/playbooks/roles/bootlinux/tasks/main.yml
@@ -223,94 +223,9 @@
run_once: true
delegate_to: localhost
-- name: Check whether config-kdevops exists
- stat:
- path: "{{ role_path }}/templates/config-kdevops"
- register: config_kdevops
- delegate_to: localhost
-
-- name: Found config-kdevops, using it for template
- set_fact:
- linux_config: "config-kdevops"
- when: config_kdevops.stat.exists
-
-- name: No config-kdevops, looking for {{ target_linux_config }}
- set_fact:
- linux_config: "{{ target_linux_config }}"
- when: not config_kdevops.stat.exists
-
-- name: Check if specific kernel config exists for {{ target_linux_ref }}
- stat:
- path: "{{ role_path }}/templates/{{ target_linux_config }}"
- register: kernel_config
- delegate_to: localhost
-
-- name: Find all linux-next configs if a your custom config-kdevops and ref config was not found
- find:
- paths: "{{ role_path }}/templates"
- patterns: "config-next*"
- file_type: file
- recurse: no
- register: found_configs
- delegate_to: localhost
- when:
- - not config_kdevops.stat.exists
- - not kernel_config.stat.exists
-
-- name: Extract the date from the filenames
- set_fact:
- configs_with_dates: "{{ configs_with_dates | default([]) + [{'file': item.path, 'date': (item.path | regex_search('config-next-(\\d{8})')).split('-')[-1]}] }}"
- loop: "{{ found_configs.files }}"
- when:
- - not config_kdevops.stat.exists
- - not kernel_config.stat.exists
- - item.path is search('config-next-(\\d{8})')
- no_log: true
- delegate_to: localhost
-
-- name: Sort configs based on date extracted from filename
- set_fact:
- sorted_configs: "{{ configs_with_dates | selectattr('date', 'defined') | sort(attribute='date', reverse=True) | map(attribute='file') | list }}"
- when:
- - not config_kdevops.stat.exists
- - not kernel_config.stat.exists
- - configs_with_dates | length > 0
- delegate_to: localhost
-
-- name: Set latest linux-next config if configs are found
- set_fact:
- latest_linux_next_config: "{{ sorted_configs[0] }}"
- when:
- - not config_kdevops.stat.exists and not kernel_config.stat.exists
- - sorted_configs | length > 0
- delegate_to: localhost
-
-- name: Use the specific kernel config or fallback to the latest linux-next
- set_fact:
- linux_config: "{{ target_linux_config | default('') if kernel_config.stat.exists else (latest_linux_next_config | default('') | basename) }}"
- when:
- - not config_kdevops.stat.exists
- - not kernel_config.stat.exists
- - latest_linux_next_config is defined
- delegate_to: localhost
-
-- name: Verify config used
- debug:
- msg: "Linux config used: {{ role_path }}/templates/{{ linux_config }}"
- delegate_to: localhost
-
-- name: Verify that the Linux configuration file exists
- stat:
- path: "{{ role_path }}/templates/{{ linux_config }}"
- register: config_stat
- delegate_to: localhost
- when: linux_config is defined
-
-- name: Fail if the configuration file does not exist
- fail:
- msg: "The configuration file {{ role_path }}/templates/{{ linux_config }} does not exist."
- when: not config_stat.stat.exists
- delegate_to: localhost
+- name: Select the .config file for building the test kernel
+ ansible.builtin.include_tasks:
+ file: "{{ role_path }}/tasks/config.yml"
- name: Copy configuration for Linux {{ target_linux_tree }} to the target nodes
template:
--
2.47.2
next prev parent reply other threads:[~2025-07-28 0:18 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 0:17 [PATCH 00/40] remove vagrant and bootlinux shape up Luis Chamberlain
2025-07-28 0:17 ` [PATCH 01/40] vagrant: remove entire vagrant configuration directory Luis Chamberlain
2025-07-28 0:17 ` [PATCH 02/40] kconfigs: fix Kconfig references after vagrant removal Luis Chamberlain
2025-07-28 0:17 ` [PATCH 03/40] scripts: remove Vagrant-specific scripts and Makefiles Luis Chamberlain
2025-07-28 0:17 ` [PATCH 04/40] playbooks: remove Vagrant-specific playbooks and roles Luis Chamberlain
2025-07-28 0:17 ` [PATCH 05/40] gitignore: remove Vagrant-specific ignore patterns Luis Chamberlain
2025-07-28 0:17 ` [PATCH 06/40] docs: remove Vagrant-specific documentation files Luis Chamberlain
2025-07-28 0:17 ` [PATCH 07/40] Remove all remaining Vagrant references from codebase Luis Chamberlain
2025-07-28 0:17 ` [PATCH 08/40] AuthorDate: Fri Jul 25 14:23:00 2025 -0400 Luis Chamberlain
2025-07-28 0:17 ` [PATCH 09/40] ansible.cfg: Explicitly set the ssh user Luis Chamberlain
2025-07-28 0:24 ` Chuck Lever
2025-07-28 0:27 ` Luis Chamberlain
2025-07-28 0:36 ` Chuck Lever
2025-07-28 0:17 ` [PATCH 10/40] fstests: local NFS list Luis Chamberlain
2025-07-28 0:17 ` [PATCH 11/40] terraform: Clean up the destroy tasks Luis Chamberlain
2025-07-28 0:17 ` [PATCH 12/40] Switch to the cloud.terraform.terraform module Luis Chamberlain
2025-07-28 0:17 ` [PATCH 13/40] terraform: Make use of the new "terraform_output" module Luis Chamberlain
2025-07-28 0:17 ` [PATCH 14/40] terraform: Move "wait_for_connection" out of the terraform playbook Luis Chamberlain
2025-07-28 0:17 ` [PATCH 15/40] terraform: Remove "delegate_to: localhost" Luis Chamberlain
2025-07-28 0:17 ` [PATCH 16/40] terraform: Replace scripts/status_terraform.sh Luis Chamberlain
2025-07-28 0:17 ` [PATCH 17/40] Kconfig: Convert the 9p option to a choice menu Luis Chamberlain
2025-07-28 0:17 ` [PATCH 18/40] bootlinux: fix making 9p default if using libvirt Luis Chamberlain
2025-07-28 0:17 ` Luis Chamberlain [this message]
2025-07-28 0:17 ` [PATCH 20/40] bootlinux: Simplify tasks that select the kernel .config to build Luis Chamberlain
2025-07-28 0:17 ` [PATCH 21/40] bootlinux: Select the kernel .config earlier Luis Chamberlain
2025-07-28 0:17 ` [PATCH 22/40] bootlinux: Move 9p build tasks to a subrole Luis Chamberlain
2025-07-28 0:17 ` [PATCH 23/40] bootlinux: fix missing make command when using 9P builds Luis Chamberlain
2025-07-28 0:17 ` [PATCH 24/40] guestsfs: ensure linux directory exists Luis Chamberlain
2025-07-28 0:17 ` [PATCH 25/40] bootlinux: Move tasks for building on target nodes to a subrole Luis Chamberlain
2025-07-28 0:17 ` [PATCH 26/40] bootlinux: Clean up a grub set-up task Luis Chamberlain
2025-07-28 0:17 ` [PATCH 27/40] bootlinux: Harden update-grub/install.yml Luis Chamberlain
2025-07-28 0:17 ` [PATCH 28/40] bootlinux: fix grub_boot_number_cmd undefined error in update-grub Luis Chamberlain
2025-07-28 0:17 ` [PATCH 29/40] bootlinux: fix kernel_release_file.stat " Luis Chamberlain
2025-07-28 0:17 ` [PATCH 30/40] Add a guest/instance for building the test kernel Luis Chamberlain
2025-07-28 0:17 ` [PATCH 31/40] bootlinux: Add a new builder choice Luis Chamberlain
2025-07-28 0:17 ` [PATCH 32/40] workflows: Add a kconfig setting for installing kernels via package Luis Chamberlain
2025-07-28 0:17 ` [PATCH 33/40] bootlinux: Enclose tasks to find kernel release name in a block: Luis Chamberlain
2025-07-28 0:17 ` [PATCH 34/40] bootlinux: Pick up kernel release info for pre-built packages Luis Chamberlain
2025-07-28 0:17 ` [PATCH 35/40] bootlinux: Install pre-built kernels from packages Luis Chamberlain
2025-07-28 0:17 ` [PATCH 36/40] bootlinux: Add an option to build with clang instead of gcc Luis Chamberlain
2025-07-28 0:17 ` [PATCH 37/40] Makefile: add make style for style checking Luis Chamberlain
2025-07-28 0:17 ` [PATCH 38/40] CLAUDE.md: new workflow guide for hosts and nodes Luis Chamberlain
2025-07-28 0:17 ` [PATCH 39/40] CLAUDE.md: add don't BS rules Luis Chamberlain
2025-07-28 0:17 ` [PATCH 40/40] gen_nodes/gen_hosts: avoid usage of fs_config_path on task names 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=20250728001800.3188617-20-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=da.gomez@kruces.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