Remove the bootlinux-local role
v2 cover Remove the bootlinux-local role
From: Chuck Lever <[email protected]>
The bootlinux-local role simply installs the bootlinux dependencies on the Ansible controller when bootlinux_9p is set. There doesn't seem to be a good reason that cannot be done via an extra step in bootlinux.
This version needs some testing, which I can get to later today.
Changes since v1:
- Address Daniel's review comments and clarify patch descriptions
Chuck Lever (4):
bootlinux: Remove the 'linux' tag
bootlinux: Modernize install-deps/main.yml
bootlinux: Switch to import_tasks for install-deps
bootlinux: Fold bootlinux-local into the bootlinux role
playbooks/bootlinux-local.yml | 5 - .../roles/bootlinux-local/defaults/main.yml | 3 - .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ---- .../tasks/install-deps/debian/main.yml | 2 - .../bootlinux/tasks/install-deps/main.yml | 21 +++-- playbooks/roles/bootlinux/tasks/main.yml | 92 ++++++++++--------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- workflows/linux/Makefile | 3 - 12 files changed, 72 insertions(+), 92 deletions(-) delete mode 100644 playbooks/bootlinux-local.yml delete mode 100644 playbooks/roles/bootlinux-local/defaults/main.yml delete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644 playbooks/roles/bootlinux-local/tasks/main.yml
Signature · 1 line
2.49.0
PATCH v2 1/4 bootlinux: Remove the 'linux' tag
From: Chuck Lever <[email protected]>
Clean up: This tag is not set by any invocation of the bootlinux role.
--- .../tasks/install-deps/debian/main.yml | 2 - playbooks/roles/bootlinux/tasks/main.yml | 80 +++++++++---------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- 6 files changed, 48 insertions(+), 52 deletions(-)
playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml +0 -2
@@ -6,7 +6,6 @@ become_method: sudo apt: update_cache: yes - tags: linux # apt-get build-dep does not capture all requirements - name: Install Linux kernel build dependencies
@@ -41,4 +40,3 @@ - libncurses-dev - b4 state: present - tags: linux
playbooks/roles/bootlinux/tasks/main.yml +39 -41
315 lines not on this page · raw message
playbooks/roles/bootlinux/tasks/update-grub/debian.yml +1 -1
@@ -5,4 +5,4 @@ command: "update-grub" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]
playbooks/roles/bootlinux/tasks/update-grub/install.yml +6 -6
@@ -76,7 +76,7 @@ path: /etc/default/grub regexp: '^GRUB_DEFAULT=' line: GRUB_DEFAULT=saved - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] - name: Use GRUB_DISABLE_SUBMENU=y to enable grub-set-default use with one digit become: yes
@@ -87,10 +87,10 @@ path: /etc/default/grub regexp: '^GRUB_DISABLE_SUBMENU=' line: GRUB_DISABLE_SUBMENU=y - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] - name: Update your boot GRUB file if necessary to ensure GRUB flat earth - tags: [ 'linux', 'uninstall-linux', 'manual-update-grub', 'console' ] + tags: [ 'uninstall-linux', 'manual-update-grub', 'console' ] import_tasks: update-grub/main.yml - name: Set file used to extract KERNELRELEASE variable
@@ -139,7 +139,7 @@ vars: target_kernel: "{{ target_linux_ref | replace('v', '') }}" register: grub_boot_number_cmd - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: kernel_release_file.stat.exists - name: Obtain command to set default kernel to boot
@@ -161,7 +161,7 @@ command: "{{ grub_set_default_boot_kernel }} \"{{ target_boot_entry }}\"" vars: target_boot_entry: "{{ grub_boot_number_cmd.stdout_lines.0 }}" - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: - grub_boot_number_cmd.rc == 0 - grub_boot_number_cmd.stdout != ""
@@ -172,7 +172,7 @@ vars: target_kernel: "{{ target_linux_ref | replace('v', '') }}" target_boot_entry: "{{ grub_boot_number_cmd.stdout_lines.0 }}" - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: - grub_boot_number_cmd.rc == 0 - grub_boot_number_cmd.stdout != ""
playbooks/roles/bootlinux/tasks/update-grub/redhat.yml +1 -1
@@ -28,4 +28,4 @@ command: "grub2-mkconfig -o {{ grub_config_file }}" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]
playbooks/roles/bootlinux/tasks/update-grub/suse.yml +1 -1
@@ -5,4 +5,4 @@ command: "update-bootloader --refresh" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]
Signature · 1 line
2.49.0
Re: [PATCH v2 1/4] bootlinux: Remove the 'linux' tag
Quoted 6 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
Clean up: This tag is not set by any invocation of the bootlinux role.
Signed-off-by Chuck Lever <[email protected]>
LGTM,
Quoted 463 lines
--- .../tasks/install-deps/debian/main.yml | 2 - playbooks/roles/bootlinux/tasks/main.yml | 80 +++++++++---------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- 6 files changed, 48 insertions(+), 52 deletions(-)playbooks/roles/bootlinux/tasks/install-deps/debian/main.yml +0
-2@@ -6,7 +6,6 @@ become_method: sudo apt: update_cache: yes - tags: linux # apt-get build-dep does not capture all requirements - name: Install Linux kernel build dependencies@@ -41,4 +40,3 @@ - libncurses-dev - b4 state: present - tags: linuxplaybooks/roles/bootlinux/tasks/main.yml +39
-41@@ -26,7 +26,6 @@ - target_linux_install_b4 is defined - target_linux_install_b4 - ansible_facts['os_family']|lower != 'debian' - tags: linux - name: Install b4 on host become: yes@@ -39,7 +38,6 @@ - target_linux_install_b4 - bootlinux_9p|bool - ansible_facts['os_family']|lower != 'debian' - tags: linux run_once: true delegate_to: localhost@@ -76,7 +74,7 @@ - name: Add safe exception for a clone command: "git config --global --add safe.directory {{ target_linux_git }}" - tags: [ 'linux', 'git', 'clone'] + tags: [ 'git', 'clone'] when: - bootlinux_9p|bool - target_linux_git is string and target_linux_git.startswith('/')@@ -114,7 +112,7 @@ delay: 5 register: result until: not result.failed - tags: [ 'linux', 'git', 'clone'] + tags: [ 'git', 'clone'] when: - not bootlinux_9p|bool@@ -129,7 +127,7 @@ delay: 5 register: result until: not result.failed - tags: [ 'linux', 'git', 'clone'] + tags: [ 'git', 'clone'] when: - bootlinux_9p|bool - not bootlinux_tree_set_by_cli|bool@@ -143,7 +141,7 @@ owner: "{{ data_user }}" group: "{{ data_group }}" mode: 0644 - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - not bootlinux_9p|bool - target_linux_extra_patch is defined@@ -153,7 +151,7 @@ src: "{{ target_linux_extra_patch }}" dest: "{{ bootlinux_9p_host_path }}/{{ target_linux_extra_patch }}" mode: 0644 - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - bootlinux_9p|bool - target_linux_extra_patch is defined@@ -164,7 +162,7 @@ command: "git am {{ target_linux_extra_patch }}" args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'git', 'extra-patch', 'skip_ansible_lint' ] + tags: [ 'git', 'extra-patch', 'skip_ansible_lint' ] when: - not bootlinux_9p|bool - target_linux_extra_patch is defined@@ -173,7 +171,7 @@ command: "git am {{ target_linux_extra_patch }}" args: chdir: "{{ bootlinux_9p_host_path }}" - tags: [ 'linux', 'git', 'extra-patch', 'skip_ansible_lint' ] + tags: [ 'git', 'extra-patch', 'skip_ansible_lint' ] when: - bootlinux_9p|bool - target_linux_extra_patch is defined@@ -188,7 +186,7 @@ if ! $(git config --get user.name) ; then git config --global user.name user fi - tags: [ 'linux', 'git', 'extra-patch', 'skip_ansible_lint' ] + tags: [ 'git', 'extra-patch', 'skip_ansible_lint' ] when: - target_linux_apply_patch_message_id is defined - target_linux_apply_patch_message_id | length > 0@@ -204,7 +202,7 @@ shell: b4 am -o - {{target_linux_apply_patch_message_id}} | git am args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'extra-patch', 'skip_ansible_lint' ] + tags: [ 'extra-patch', 'skip_ansible_lint' ] when: - not bootlinux_9p|bool - target_linux_apply_patch_message_id is defined@@ -215,7 +213,7 @@ shell: b4 am -o - {{target_linux_apply_patch_message_id}} | git am args: chdir: "{{ bootlinux_9p_host_path }}" - tags: [ 'linux', 'extra-patch', 'skip_ansible_lint' ] + tags: [ 'extra-patch', 'skip_ansible_lint' ] when: - bootlinux_9p|bool - target_linux_apply_patch_message_id is defined@@ -320,7 +318,7 @@ owner: "{{ data_user }}" group: "{{ data_group }}" mode: 0644 - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - not bootlinux_9p|bool@@ -329,7 +327,7 @@ src: "{{ linux_config }}" dest: "{{ bootlinux_9p_host_path }}/.config" mode: 0644 - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - bootlinux_9p|bool run_once: true@@ -337,14 +335,14 @@ - name: Set kernel localversion if requested on the target nodes shell: "echo {{ target_linux_localversion }} > {{ target_linux_dir_path }}/localversion" - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - not bootlinux_9p|bool - target_linux_localversion is defined and target_linux_localversion != "" - name: Set kernel localversion if requested on the control node shell: "echo {{ target_linux_localversion }} > {{ bootlinux_9p_host_path }}/localversion" - tags: [ 'linux', 'git', 'config' ] + tags: [ 'git', 'config' ] when: - bootlinux_9p|bool - target_linux_localversion is defined and target_linux_localversion != ""@@ -361,7 +359,7 @@ args: chdir: "{{ target_linux_dir_path }}" executable: /bin/bash - tags: [ 'linux', 'oldconfig' ] + tags: [ 'oldconfig' ] when: - not bootlinux_9p|bool@@ -375,7 +373,7 @@ args: chdir: "{{ bootlinux_9p_host_path }}" executable: /bin/bash - tags: [ 'linux', 'oldconfig' ] + tags: [ 'oldconfig' ] when: - bootlinux_9p|bool run_once: true@@ -387,7 +385,7 @@ changed_when: "build.rc == 0" args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - not bootlinux_9p|bool@@ -397,7 +395,7 @@ changed_when: "build_cxl_test.rc == 0" args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'build-linux', 'cxl-build' ] + tags: [ 'build-linux', 'cxl-build' ] when: - not bootlinux_9p|bool - bootlinux_cxl_test|bool@@ -406,7 +404,7 @@ stat: path: "{{ target_linux_dir_path }}/certs/signing_key.pem" register: snaik_oil_file - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - not bootlinux_9p|bool@@ -414,14 +412,14 @@ file: path: "{{ target_linux_dir_path }}/certs/signing_key.pem" mode: "0755" - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - not bootlinux_9p|bool - snaik_oil_file.stat.exists - name: Get nproc on the control node command: "{{ num_jobs }}" - tags: [ 'linux', 'build-linux', 'configure', 'cxl-build' ] + tags: [ 'build-linux', 'configure', 'cxl-build' ] register: nproc_9p when: - bootlinux_9p|bool@@ -433,7 +431,7 @@ chdir: "{{ bootlinux_9p_host_path }}" target: kernelversion register: target_linux_kernelversion - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool - target_linux_kernelrelease | length > 0@@ -443,7 +441,7 @@ - name: Generate user kernelrelease {{ target_linux_kernelversion.stdout }}-{{ target_linux_kernelrelease }} set_fact: target_user_kernelrelease: "{{ target_linux_kernelversion.stdout }}-{{ target_linux_kernelrelease }}" - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool - target_linux_kernelrelease | length > 0@@ -456,7 +454,7 @@ chdir: "{{ bootlinux_9p_host_path }}" params: KERNELRELEASE={{ target_user_kernelrelease }} - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool - target_linux_kernelrelease | length > 0@@ -467,7 +465,7 @@ make: jobs: "{{ nproc_9p.stdout }}" chdir: "{{ bootlinux_9p_host_path }}" - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool - target_linux_kernelrelease | length == 0@@ -480,7 +478,7 @@ chdir: "{{ bootlinux_9p_host_path }}" params: M: "tools/testing/cxl" - tags: [ 'linux', 'build-linux', 'cxl-build' ] + tags: [ 'build-linux', 'cxl-build' ] when: - bootlinux_9p|bool - bootlinux_cxl_test|bool@@ -491,7 +489,7 @@ stat: path: "{{ bootlinux_9p_host_path }}/certs/signing_key.pem" register: snaik_oil_file_9p - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool run_once: true@@ -501,7 +499,7 @@ file: path: "{{ bootlinux_9p_host_path }}/certs/signing_key.pem" mode: "0755" - tags: [ 'linux', 'build-linux' ] + tags: [ 'build-linux' ] when: - bootlinux_9p|bool - snaik_oil_file_9p.stat.exists@@ -552,7 +550,7 @@ - "{{ uninstall_kernel_ver }}" - "{{ uninstall_kernel_ver }}+" register: found_uninstall_kfiles - tags: [ 'linux', 'uninstall-linux' ] + tags: [ 'uninstall-linux' ] when: - uninstall_kernel_enable|bool - uninstall_kernel_ver is defined@@ -564,7 +562,7 @@ file: state: absent path: "{{ item.path }}" - tags: [ 'linux', 'uninstall-linux' ] + tags: [ 'uninstall-linux' ] with_items: - "{{ found_uninstall_kfiles.files }}" loop_control:@@ -585,10 +583,10 @@ path: /etc/default/grub regexp: '^GRUB_TERMINAL=' line: GRUB_TERMINAL="console serial" - tags: [ 'linux', 'git', 'config', 'console' ] + tags: [ 'git', 'config', 'console' ] - name: Update your boot GRUB file if necessary - tags: [ 'linux', 'uninstall-linux', 'manual-update-grub', 'console' ] + tags: [ 'uninstall-linux', 'manual-update-grub', 'console' ] import_tasks: update-grub/main.yml - name: Ensure we have DEFAULTDEBUG set@@ -600,7 +598,7 @@ path: /etc/sysconfig/kernel regexp: '^DEFAULTDEBUG=' line: DEFAULTDEBUG=yes - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: ansible_facts['os_family']|lower == 'redhat' - name: Install {{ target_linux_tree }} on the target nodes@@ -612,7 +610,7 @@ changed_when: "install_done.rc == 0" args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'install-linux' ] + tags: [ 'install-linux' ] - name: Install {{ target_linux_tree }} cxl_test on the target nodes become: yes@@ -623,12 +621,12 @@ changed_when: "install_done.rc == 0" args: chdir: "{{ target_linux_dir_path }}" - tags: [ 'linux', 'install-linux', 'cxl-install' ] + tags: [ 'install-linux', 'cxl-install' ] when: - kdevops_workflow_enable_cxl|bool - name: Set the default kernel if necessary - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] import_tasks: update-grub/install.yml # when: # - ansible_facts['os_family']|lower != 'redhat'@@ -637,16 +635,16 @@ become: yes become_method: sudo reboot: - tags: [ 'linux', 'reboot' ] + tags: [ 'reboot' ] - name: Run uname command: "uname -r" register: uname_cmd - tags: [ 'linux', 'git', 'config', 'uname' ] + tags: [ 'git', 'config', 'uname' ] - name: Check kernel uname debug: msg: "Target kernel {{ target_linux_ref }} Running kernel {{ running_kernel }}" vars: running_kernel: "{{ uname_cmd.stdout_lines.0 }}" - tags: [ 'linux', 'git', 'config', 'uname' ] + tags: [ 'git', 'config', 'uname' ]playbooks/roles/bootlinux/tasks/update-grub/debian.yml +1
-1@@ -5,4 +5,4 @@ command: "update-grub" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]playbooks/roles/bootlinux/tasks/update-grub/install.yml +6
-6@@ -76,7 +76,7 @@ path: /etc/default/grub regexp: '^GRUB_DEFAULT=' line: GRUB_DEFAULT=saved - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] - name: Use GRUB_DISABLE_SUBMENU=y to enable grub-set-default use with one digit become: yes@@ -87,10 +87,10 @@ path: /etc/default/grub regexp: '^GRUB_DISABLE_SUBMENU=' line: GRUB_DISABLE_SUBMENU=y - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] - name: Update your boot GRUB file if necessary to ensure GRUB flat earth - tags: [ 'linux', 'uninstall-linux', 'manual-update-grub', 'console' ] + tags: [ 'uninstall-linux', 'manual-update-grub', 'console' ] import_tasks: update-grub/main.yml - name: Set file used to extract KERNELRELEASE variable@@ -139,7 +139,7 @@ vars: target_kernel: "{{ target_linux_ref | replace('v', '') }}" register: grub_boot_number_cmd - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: kernel_release_file.stat.exists - name: Obtain command to set default kernel to boot@@ -161,7 +161,7 @@ command: "{{ grub_set_default_boot_kernel }} \"{{ target_boot_entry }}\"" vars: target_boot_entry: "{{ grub_boot_number_cmd.stdout_lines.0 }}" - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: - grub_boot_number_cmd.rc == 0 - grub_boot_number_cmd.stdout != ""@@ -172,7 +172,7 @@ vars: target_kernel: "{{ target_linux_ref | replace('v', '') }}" target_boot_entry: "{{ grub_boot_number_cmd.stdout_lines.0 }}" - tags: [ 'linux', 'git', 'config', 'saved' ] + tags: [ 'git', 'config', 'saved' ] when: - grub_boot_number_cmd.rc == 0 - grub_boot_number_cmd.stdout != ""playbooks/roles/bootlinux/tasks/update-grub/redhat.yml +1
-1@@ -28,4 +28,4 @@ command: "grub2-mkconfig -o {{ grub_config_file }}" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]playbooks/roles/bootlinux/tasks/update-grub/suse.yml +1
-1@@ -5,4 +5,4 @@ command: "update-bootloader --refresh" register: grub_update changed_when: "grub_update.rc == 0" - tags: [ 'linux', 'manual-update-grub', 'console' ] + tags: [ 'manual-update-grub', 'console' ]
PATCH v2 2/4 bootlinux: Modernize install-deps/main.yml
In reply to [email protected]From: Chuck Lever <[email protected]>
Clean-up: Address ansible-lint complaints:
fqcn[action-core]: Use FQCN for builtin module actions (import_tasks). playbooks/roles/bootlinux/tasks/install-deps/main.yml:2 Use ansible.builtin.import_tasks or ansible.legacy.import_tasks instead.
name[casing]: All names should start with an uppercase letter. playbooks/roles/bootlinux/tasks/install-deps/main.yml:2 Task/Handler: oscheck distribution ospecific setup
fqcn[action-core]: Use FQCN for builtin module actions (import_tasks). playbooks/roles/bootlinux/tasks/install-deps/main.yml:5 Use ansible.builtin.import_tasks or ansible.legacy.import_tasks instead.
name[missing]: All tasks should be named. playbooks/roles/bootlinux/tasks/install-deps/main.yml:5 Task/Handler: import_tasks suse/main.yml
fqcn[action-core]: Use FQCN for builtin module actions (import_tasks). playbooks/roles/bootlinux/tasks/install-deps/main.yml:7 Use ansible.builtin.import_tasks or ansible.legacy.import_tasks instead.
name[missing]: All tasks should be named. playbooks/roles/bootlinux/tasks/install-deps/main.yml:7 Task/Handler: import_tasks redhat/main.yml
--- .../bootlinux/tasks/install-deps/main.yml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
playbooks/roles/bootlinux/tasks/install-deps/main.yml +14 -7
@@ -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.import_tasks: debian/main.yml + when: + - ansible_os_family == "Debian" + +- name: SuSE-specific setup + ansible.builtin.import_tasks: suse/main.yml + when: + - ansible_os_family == "Suse" + +- name: Red Hat-specific setup + ansible.builtin.import_tasks: redhat/main.yml + when: + - ansible_os_family == "RedHat"
Signature · 1 line
2.49.0
Re: [PATCH v2 2/4] bootlinux: Modernize install-deps/main.yml
Quoted 13 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
Clean-up: Address ansible-lint complaints:
fqcn[action-core]: Use FQCN for builtin module actions (
import_tasks).playbooks/roles/bootlinux/tasks/install-deps/main.yml:2Useansible.builtin.import_tasksoransible.legacy.import_tasksinstead.name[casing]: All names should start with an uppercase letter.
playbooks/roles/bootlinux/tasks/install-deps/main.yml:2Task/Handler: oscheck distribution ospecific setupfqcn[action-core]: Use FQCN for builtin module actions (
import_tasks).playbooks/roles/bootlinux/tasks/install-deps/main.yml:5Useansible.builtin.import_tasksoransible.legacy.import_tasksinstead.
Quoted 8 lines
name[missing]: All tasks should be named.
playbooks/roles/bootlinux/tasks/install-deps/main.yml:5Task/Handler:import_taskssuse/main.ymlfqcn[action-core]: Use FQCN for builtin module actions (
import_tasks).playbooks/roles/bootlinux/tasks/install-deps/main.yml:7Useansible.builtin.import_tasksoransible.legacy.import_tasksinstead.name[missing]: All tasks should be named.
playbooks/roles/bootlinux/tasks/install-deps/main.yml:7Task/Handler:import_tasksredhat/main.yml
Can you reformat this to 72 char limit for commit message lines?
I'll soon send a patch to add Ansible linting to CI, so we can catch any future attempts that might break existing fixes.
Quoted 2 lines
Signed-off-by Chuck Lever <[email protected]>
Quoted 31 lines
--- .../bootlinux/tasks/install-deps/main.yml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)playbooks/roles/bootlinux/tasks/install-deps/main.yml +14
-7@@ -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.import_tasks: debian/main.yml + when: + - ansible_os_family == "Debian" + +- name: SuSE-specific setup + ansible.builtin.import_tasks: suse/main.yml + when: + - ansible_os_family == "Suse" + +- name: Red Hat-specific setup + ansible.builtin.import_tasks: redhat/main.yml + when: + - ansible_os_family == "RedHat"
PATCH v2 3/4 bootlinux: Switch to import_tasks for install-deps
In reply to [email protected]From: Chuck Lever <[email protected]>
The bootlinux role includes install-deps/main.yml, but install-deps/main.yml imports the distribution-specific tasks. It's better to avoid mixing import_tasks and include_tasks:
Switch bootlinux/tasks/main.yml to use import_tasks.
--- playbooks/roles/bootlinux/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
playbooks/roles/bootlinux/tasks/main.yml +2 -2
@@ -11,8 +11,8 @@ tags: vars # Distro specific -- name: Install dependencies - include_tasks: +- name: Install dependencies to build and install the Linux kernel + ansible.builtin.import_tasks: file: install-deps/main.yml # We do this regardless of what distro you use
Signature · 1 line
2.49.0
Re: [PATCH v2 3/4] bootlinux: Switch to import_tasks for install-deps
Quoted 11 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
The bootlinux role includes
install-deps/main.yml, butinstall-deps/main.ymlimports the distribution-specific tasks. It's better to avoid mixingimport_tasksandinclude_tasks:Switch
bootlinux/tasks/main.ymlto useimport_tasks.Signed-off-by Chuck Lever <[email protected]>
Quoted 9 lines
--- playbooks/roles/bootlinux/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)playbooks/roles/bootlinux/tasks/main.yml +0
-0
playbooks/roles/bootlinux/tasks/main.yml line 15
Quoted 7 lines
playbooks/roles/bootlinux/tasks/main.yml +2
-2@@ -11,8 +11,8 @@ tags: vars # Distro specific -- name: Install dependencies - include_tasks: +- name: Install dependencies to build and install the Linux kernel + ansible.builtin.import_tasks:
In this case, both modules have the same behaviour when invoked with/without the --tags argument. So, it's okay doing the conversion.
Quoted 3 lines
playbooks/roles/bootlinux/tasks/main.yml +0
-0file: install-deps/main.yml # We do this regardless of what distro you use
PATCH v2 4/4 bootlinux: Fold bootlinux-local into the bootlinux role
In reply to [email protected]From: Chuck Lever <[email protected]>
Clean up: Adopt the more common mechanism for running a local action instead of running a separate play.
No change in behavior is expected.
--- playbooks/bootlinux-local.yml | 5 ----- .../roles/bootlinux-local/defaults/main.yml | 3 --- .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ------------------- playbooks/roles/bootlinux/tasks/main.yml | 8 ++++++++ workflows/linux/Makefile | 3 --- 6 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 playbooks/bootlinux-local.yml delete mode 100644 playbooks/roles/bootlinux-local/defaults/main.yml delete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644 playbooks/roles/bootlinux-local/tasks/main.yml
playbooks/bootlinux-local.yml deleted +0 -5
@@ -1,5 +0,0 @@ ---- -- hosts: localhost - connection: local - roles: - - role: bootlinux-local
playbooks/roles/bootlinux-local/defaults/main.yml deleted +0 -3
@@ -1,3 +0,0 @@ -# SPDX-License-Identifier copyleft-next-0.3.1 ---- -bootlinux_9p: False
playbooks/roles/bootlinux-local/tasks/install-deps deleted +0 -1
@@ -1 +0,0 @@ -../../bootlinux/tasks/install-deps/
playbooks/roles/bootlinux-local/tasks/main.yml deleted +0 -19
@@ -1,19 +0,0 @@ ---- -- name: Import optional extra_args file - include_vars: "{{ item }}" - ignore_errors: yes - with_first_found: - - files: - - "../extra_vars.yml" - - "../extra_vars.yaml" - - "../extra_vars.json" - skip: true - tags: vars - -- name: Install dependencies to build Linux on host - tags: [ 'deps' ] - run_once: true - local_action: import_tasks install-deps/main.yml - when: - - bootlinux_9p|bool -
playbooks/roles/bootlinux/tasks/main.yml +8 -0
@@ -15,6 +15,14 @@ ansible.builtin.import_tasks: file: install-deps/main.yml +- name: Install dependencies to build the Linux kernel + delegate_to: localhost + run_once: true + ansible.builtin.import_tasks: + file: install-deps/main.yml + when: + - bootlinux_9p|bool + # We do this regardless of what distro you use - name: Install b4 become: yes
workflows/linux/Makefile +0 -3
@@ -90,9 +90,6 @@ LINUX_HELP_EXTRA := PHONY += linux linux: $(KDEVOPS_NODES) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux-local.yml \ - --extra-vars="$(BOOTLINUX_ARGS)" $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \ $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ --extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
Signature · 1 line
2.49.0
Re: [PATCH v2 4/4] bootlinux: Fold bootlinux-local into the bootlinux role
Quoted 8 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
Clean up: Adopt the more common mechanism for running a local action instead of running a separate play.
No change in behavior is expected.
Signed-off-by Chuck Lever <[email protected]>
Quoted 72 lines
--- playbooks/bootlinux-local.yml | 5 ----- .../roles/bootlinux-local/defaults/main.yml | 3 --- .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ------------------- playbooks/roles/bootlinux/tasks/main.yml | 8 ++++++++ workflows/linux/Makefile | 3 --- 6 files changed, 8 insertions(+), 31 deletions(-)delete mode 100644
playbooks/bootlinux-local.yml
delete mode 100644playbooks/roles/bootlinux-local/defaults/main.ymldelete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644playbooks/roles/bootlinux-local/tasks/main.ymlplaybooks/bootlinux-local.yml deleted +0
-5@@ -1,5 +0,0 @@ ---- -- hosts: localhost - connection: local - roles: - - role: bootlinux-localplaybooks/roles/bootlinux-local/defaults/main.yml deleted +0
-3@@ -1,3 +0,0 @@ -# SPDX-License-Identifier copyleft-next-0.3.1 ---- -bootlinux_9p: Falseplaybooks/roles/bootlinux-local/tasks/install-deps deleted +0
-1@@ -1 +0,0 @@ -../../bootlinux/tasks/install-deps/playbooks/roles/bootlinux-local/tasks/main.yml deleted +0
-19@@ -1,19 +0,0 @@ ---- -- name: Import optional extra_args file - include_vars: "{{ item }}" - ignore_errors: yes - with_first_found: - - files: - - "../extra_vars.yml" - - "../extra_vars.yaml" - - "../extra_vars.json" - skip: true - tags: vars - -- name: Install dependencies to build Linux on host - tags: [ 'deps' ] - run_once: true - local_action: import_tasks install-deps/main.yml - when: - - bootlinux_9p|bool -playbooks/roles/bootlinux/tasks/main.yml +0
-0@@ -15,6 +15,14 @@ ansible.builtin.import_tasks:
playbooks/roles/bootlinux/tasks/main.yml line 25
Quoted 10 lines
playbooks/roles/bootlinux/tasks/main.yml +8
-0file: install-deps/main.yml +- name: Install dependencies to build the Linux kernel + delegate_to: localhost + run_once: true + ansible.builtin.import_tasks: + file: install-deps/main.yml + when: + - bootlinux_9p|bool +
Nit: I think spaces are preferred with '| bool' filter.
Quoted 17 lines
playbooks/roles/bootlinux/tasks/main.yml +0
-0# We do this regardless of what distro you use - name: Install b4 become: yesworkflows/linux/Makefile +0
-3@@ -90,9 +90,6 @@ LINUX_HELP_EXTRA := PHONY += linux linux: $(KDEVOPS_NODES) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux-local.yml \ - --extra-vars="$(BOOTLINUX_ARGS)" $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \ $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \ --extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
Quoted 8 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
The bootlinux-local role simply installs the bootlinux dependencies on the Ansible controller when
bootlinux_9pis set. There doesn't seem to be a good reason that cannot be done via an extra step in bootlinux.This version needs some testing, which I can get to later today.
I've also tested this series here:
https://github.com/linux-kdevops/kdevops/actions/runs/15135610179/job/42546562244
Quoted 28 lines
Changes since v1:
- Address Daniel's review comments and clarify patch descriptionsChuck Lever (4):
bootlinux: Remove the 'linux' tag
bootlinux: Modernizeinstall-deps/main.yml
bootlinux: Switch toimport_tasksfor install-deps
bootlinux: Fold bootlinux-local into the bootlinux roleplaybooks/bootlinux-local.yml | 5 - .../roles/bootlinux-local/defaults/main.yml | 3 - .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ---- .../tasks/install-deps/debian/main.yml | 2 - .../bootlinux/tasks/install-deps/main.yml | 21 +++-- playbooks/roles/bootlinux/tasks/main.yml | 92 ++++++++++--------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- workflows/linux/Makefile | 3 - 12 files changed, 72 insertions(+), 92 deletions(-)delete mode 100644
playbooks/bootlinux-local.yml
delete mode 100644playbooks/roles/bootlinux-local/defaults/main.ymldelete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644playbooks/roles/bootlinux-local/tasks/main.yml
Daniel Gomez
Tested-byQuoted 10 lines · Daniel Gomez
Quoted 7 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
The bootlinux-local role simply installs the bootlinux dependencies on the Ansible controller when
bootlinux_9pis set. There doesn't seem to be a good reason that cannot be done via an extra step in bootlinux.
Quoted 6 lines
Quoted 1 line
This version needs some testing, which I can get to later today.
I've also tested this series here:
https://github.com/linux-kdevops/kdevops/actions/runs/15135610179/ job/42546562244
I've also tested this series manually on my setup and looks good.
Quoted 31 lines
Quoted 30 lines
Changes since v1:
- Address Daniel's review comments and clarify patch descriptionsChuck Lever (4):
bootlinux: Remove the 'linux' tag
bootlinux: Modernizeinstall-deps/main.yml
bootlinux: Switch toimport_tasksfor install-deps
bootlinux: Fold bootlinux-local into the bootlinux roleplaybooks/bootlinux-local.yml | 5 - .../roles/bootlinux-local/defaults/main.yml | 3 - .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ---- .../tasks/install-deps/debian/main.yml | 2 - .../bootlinux/tasks/install-deps/main.yml | 21 +++-- playbooks/roles/bootlinux/tasks/main.yml | 92 ++++++++++--------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- workflows/linux/Makefile | 3 -
12 files changed, 72 insertions(+), 92 deletions(-)delete mode 100644
playbooks/bootlinux-local.yml
delete mode 100644playbooks/roles/bootlinux-local/defaults/main.ymldelete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644playbooks/roles/bootlinux-local/tasks/main.yml
Quoted 16 lines · Daniel Gomez
Quoted 13 lines · Daniel Gomez
Quoted 8 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
The bootlinux-local role simply installs the bootlinux dependencies on the Ansible controller when
bootlinux_9pis set. There doesn't seem to be a good reason that cannot be done via an extra step in bootlinux.This version needs some testing, which I can get to later today.
Quoted 8 lines
Quoted 4 lines
I've also tested this series here:
https://github.com/linux-kdevops/kdevops/actions/runs/15135610179/
job/42546562244I've also tested this series manually on my setup and looks good.
Tested-by Daniel Gomez <[email protected]>
Thank you!
I mistakenly assumed your testing and review was complete after the first message this morning and already merged it earlier today. I will try to be more patient next time.
Quoted 28 lines
Quoted 28 lines
Quoted 27 lines
Changes since v1:
- Address Daniel's review comments and clarify patch descriptionsChuck Lever (4):
bootlinux: Remove the 'linux' tag
bootlinux: Modernizeinstall-deps/main.yml
bootlinux: Switch toimport_tasksfor install-deps
bootlinux: Fold bootlinux-local into the bootlinux roleplaybooks/bootlinux-local.yml | 5 - .../roles/bootlinux-local/defaults/main.yml | 3 - .../roles/bootlinux-local/tasks/install-deps | 1 - .../roles/bootlinux-local/tasks/main.yml | 19 ---- .../tasks/install-deps/debian/main.yml | 2 - .../bootlinux/tasks/install-deps/main.yml | 21 +++-- playbooks/roles/bootlinux/tasks/main.yml | 92 ++++++++++--------- .../bootlinux/tasks/update-grub/debian.yml | 2 +- .../bootlinux/tasks/update-grub/install.yml | 12 +-- .../bootlinux/tasks/update-grub/redhat.yml | 2 +- .../bootlinux/tasks/update-grub/suse.yml | 2 +- workflows/linux/Makefile | 3 -
12 files changed, 72 insertions(+), 92 deletions(-)delete mode 100644
playbooks/bootlinux-local.yml
delete mode 100644playbooks/roles/bootlinux-local/defaults/main.ymldelete mode 120000 playbooks/roles/bootlinux-local/tasks/install-deps delete mode 100644playbooks/roles/bootlinux-local/tasks/main.yml
Signature · 1 line
Chuck Lever
Quoted 24 lines · Chuck Lever
Quoted 23 lines · Daniel Gomez
Quoted 10 lines · Daniel Gomez
Quoted 7 lines · On 19/05/2025 18.21, [email protected] wrote:
From: Chuck Lever <[email protected]>
The bootlinux-local role simply installs the bootlinux dependencies on the Ansible controller when
bootlinux_9pis set. There doesn't seem to be a good reason that cannot be done via an extra step in bootlinux.Quoted 7 lines
Quoted 1 line
This version needs some testing, which I can get to later today.
I've also tested this series here:
https://github.com/linux-kdevops/kdevops/actions/runs/15135610179/
job/42546562244I've also tested this series manually on my setup and looks good.
Quoted 7 lines
Quoted 1 line
Tested-by Daniel Gomez <[email protected]>Thank you!
I mistakenly assumed your testing and review was complete after the first message this morning and already merged it earlier today. I will try to be more patient next time.
No problem!