From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4AC3F3F9FB for ; Mon, 28 Jul 2025 00:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661886; cv=none; b=m80I3QwiIBN7XoCjJ5waw2KN+yi+K2zoD8DYjy8wDKleS/O+scM+N8WqbHRKT9JFkC3wQyEEozrcrr4ihJLCsB9eZIh3P9zvFDrqVFrefYl+QMr4JVAY01ar7G2JKHWou4YK4HRKR6VGg4N37YFGkmbDwg1Z6chusjeMutJ520Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661886; c=relaxed/simple; bh=mh0e7GALFcSXo7rm6po9mrOhMUdDu4zNLgIUwbPGIEA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nTORWt0NN/dNgNlMK29VxGen3cnZ/rdba4T/NGx3k4nrFZvEA3V/tdZXoiKzA9X6JgetENFtqd4db8UUshe8tMfQyHxmxL1TzN6J8d5Re9LakJSueX0lQVwOeJ130jEuGwMjSJFGaPIHKWv5XFk1KhX0tUaD4F9VSHjb35t/MQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Wl5i2UX9; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Wl5i2UX9" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=IwSh3/qOW1suLeJK1cKqvgou/Zq6V6HRM2Z34DY7YJ4=; b=Wl5i2UX9LHRp+IUCf/KNMEv5e4 kYkGl7k0oFweUajtF1/oITkHNT98sa6F7yRpmbQSc6HjA8Op7oV4o+ylSooJ3/Fn7cDW2UaZKI1se 5ZWgQDTKOQZsmX75ewTcXfJAKoZtUHW39mPR+x18Ls4ktE2L+fhRj5XMUYH3NMAjQbSSQHnUYSSPY J1K9+x68RGaysxqWCnfzPbVH7iCyDZMi5lX3nX0s+ip49tWYZ3Xh7plP7nrmm1eRq/nSrEbC3t8nh JKGUmXaeGLUzANxWL2LujAqhuCcqxFo2v4WKaug2py2q6guuBvijBhYUVhgkSmwdPz6A4sxK55oeu KN8WTFIg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugBZ4-0000000DNXa-3Zeg; Mon, 28 Jul 2025 00:18:02 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH 26/40] bootlinux: Clean up a grub set-up task Date: Sun, 27 Jul 2025 17:17:45 -0700 Message-ID: <20250728001800.3188617-27-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728001800.3188617-1-mcgrof@kernel.org> References: <20250728001800.3188617-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain From: Chuck Lever The "target_kernel" variable seems to be unused, so remove it. Address several ansible-lint complaints: - command-instead-of-shell - fqcn[action-core]: Use FQCN for builtin module actions (shell). - jinja[spacing]: Jinja2 spacing could be improved - name[template]: Jinja templates should only be at the end of 'name' - no-changed-when - schema[tasks]: 'become_method' must be one of the currently available values - yaml[line-length]: Line too long (176 > 160 characters) - yaml[truthy]: Truthy value should be one of [false, true] - yaml[brackets]: Too many spaces inside brackets - fqcn[action-core]: Use FQCN for builtin module actions (set_fact). Note: The preferred way to select a shell script and run it on a managed system is to use the template module to copy the selected script to each target host, and then use the Ansible scripts module to run it. That could be for another day. Signed-off-by: Chuck Lever --- .../bootlinux/tasks/update-grub/install.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/playbooks/roles/bootlinux/tasks/update-grub/install.yml b/playbooks/roles/bootlinux/tasks/update-grub/install.yml index 907f0a18..8402c09b 100644 --- a/playbooks/roles/bootlinux/tasks/update-grub/install.yml +++ b/playbooks/roles/bootlinux/tasks/update-grub/install.yml @@ -131,16 +131,19 @@ # is either you do the work to enhance the heuristic or live happy with the # assumption that grub2's default of picking the latest kernel is the best # option. -- name: Try to find your target kernel's GRUB boot entry number now that the menu is flattened for {{ target_linux_ref }} using inferred KERNELRELEASE {{ kernelrelease.stdout}} - become: yes +- name: Determine the target kernel's GRUB boot entry number + # noqa: command-instead-of-shell + tags: + - saved + become: true become_flags: 'su - -c' - become_method: sudo - shell: " {{ determine_default_kernel_id }} " - vars: - target_kernel: "{{ target_linux_ref | replace('v', '') }}" + become_method: ansible.builtin.sudo + ansible.builtin.shell: + cmd: "{{ determine_default_kernel_id }}" register: grub_boot_number_cmd - tags: [ 'saved' ] - when: kernel_release_file.stat.exists + changed_when: false + when: + - kernel_release_file.stat.exists - name: Obtain command to set default kernel to boot set_fact: -- 2.47.2