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 5115018C928 for ; Mon, 28 Jul 2025 01:14:37 +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=1753665282; cv=none; b=ZE6XGDO1hmfNUcWSZBIt190ZGtGglCafgALQv1+9lrBxdDc5dbRpZfcqNjt6h5a+ZAFIbWlhH2ZJKHhbEht7FwYgHybl+oMt+Mf6t3yaz5VTDRoL0nhmN5ZKaBO0lnNeBR/doTUn5L0G+iwZaRACRof2zG2mLC5cHDjJQEz0jcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753665282; c=relaxed/simple; bh=mh0e7GALFcSXo7rm6po9mrOhMUdDu4zNLgIUwbPGIEA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K3aGX0ukW9rydk6qIW3o2ko0G1ycJ+rL2mWVlSQTAvAuyHt+tf0RzxzG3XKIKmtxznaKS5PSTWJ0+2zIGFa1nOq+ubYP0GBeBLBz7iWE5W9c3rfvEEtu7Vm2DRJGxjkfmoU+WiIHFacCyap7I5yx6dRMSt/BSF5oUPjfJKrcsik= 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=Cgr/Zmt8; 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="Cgr/Zmt8" 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=Cgr/Zmt8Xfddlz2EPfSasXPwMx 2wZhFLyR8r04vNuOKROVfH1x+kUSMvZJ7eaY05vTzHE7jyL8KUhG4qWfp7VMkmV3xkI2iNo3NML8H BAG2EJaF/6HuwEZ6zrElXZ1jGvN8s4MBCLOuURSY8teOGP0TnMTSQ9WllctZELXveNZkboAvRyDpG NJP8HWrCLVmr/GXUO/bz9gRKK+T+jKDnPJfXv7OaL0UqHH34+nSYivX0+MqpP+hiKO3jxJpI2Kp7t mowaiTSgrEotquHtUI2ChcAOmWUdDmzUW25b+QMIwuAu0YSPmbeHuNRbbFtpdg9KBnquLIOtvUgBG 1qR++dzQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugCRo-0000000DPkU-17Ah; Mon, 28 Jul 2025 01:14:36 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH v2 21/33] bootlinux: Clean up a grub set-up task Date: Sun, 27 Jul 2025 18:14:21 -0700 Message-ID: <20250728011434.3197091-22-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728011434.3197091-1-mcgrof@kernel.org> References: <20250728011434.3197091-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