From patchwork Fri Apr 4 20:01:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 14038895 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1131E221704 for ; Fri, 4 Apr 2025 20:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743796882; cv=none; b=e36Ys1nl8OegNxyS2PBXzlDTFnzTJqyYLJfihRjJidg12PxVuVwKPnG1ani3cReEiS0RLklLtGAKZ+50IBb5J+7vxnW0LYAqiZ3q3YPFUSaVf337WFHsOaeZ0Kdz0sLZnOjWvvfKTuASwQHV3fR6OSiCZcL8TC/zUP6Lf6utc4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743796882; c=relaxed/simple; bh=CRRYypEXcOfT35ZPgW0xE+CGwika0k/r/mCIV4HkLZo=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=FHPqa7Pn0rr7aox0QDZX/pkiQ92vr4ahhMkCkm4QJ7UIlKYHpFeJTPerQBM3Zat8c0L65XSSYW+K7r/zM2sWvFYLdtu6fAVuC1IprcxCnQgGGtnQlQVeJE5Y3xSGvB7zUdyQZCUXWMs88oDQbeFoMeWvjTZBa7xqxdn21a/RPjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C9mX3sGJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C9mX3sGJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1730C4CEDD; Fri, 4 Apr 2025 20:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743796881; bh=CRRYypEXcOfT35ZPgW0xE+CGwika0k/r/mCIV4HkLZo=; h=From:Subject:Date:To:Cc:From; b=C9mX3sGJl/KJzpcAv7NohMFSoYo8EIJRfZYkj7fRzx23OgTXzZSoPJjbdiO6ct74A LjGjFXLtT09jX5945Ws4kZ9LmfEyPnA4R/V5eJvh8Xg9HxLGxvxXwMkn5YjOjzIAvj 0tRKUVxrWwnyr78cdyYhNIpN5J6tGWtpoy8ZPrvMXjCCMArbB2nIsD51H/w/FHYJBG 8aUKSQuFrgKeKuPX08/C91ghtbc12ruHB7FdBvLM5HeARjG8i1BovhFjsk/o4tnLrp LgIVjZu+ECBnzB1jvltvnHKNMNTbZ5S62tn9aOxFJskn1e1PI2aqOKlcmJ7OG4cYrc E1OsdIfHsGcbA== From: Daniel Gomez Subject: [PATCH 0/2] python interpreter in ansible.cfg Date: Fri, 04 Apr 2025 20:01:14 +0000 Message-Id: <20250404-python-interpreter-v1-0-04783b627ce7@samsung.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAIo68GcC/x2MQQqAIBBFrxKzTpikIrpKtFAbazYqKlFEd29o8 +A9+P+BQpmpwNw8kOnkwjGIdG0D7jBhJ8WbOGjUA/aoVbrrEYPiUCmnTELlrMXR9Ogm70GGkj1 f/+myvu8Hmzj03WQAAAA= X-Change-ID: 20250402-python-interpreter-cbb06a40c8ff To: Daniel Gomez , Luis Chamberlain Cc: kdevops@lists.linux.dev, Daniel Gomez X-Mailer: b4 0.14.2 This adds support for the Ansible Python Interpreter [1] in Kconfig and cli. Instead of setting the interpreter individually for every task/target, just set it globally with the Ansible variable dedicated for it (interpreter_python). Set the default interpreter to auto_silent to silent the warning. From documentation [2]: "The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting auto_silent or auto_legacy_silent" 'auto_silent' will prevent this warning: TASK [Gathering Facts] [started TASK: Gathering Facts on localhost] Warning: : Platform linux on host localhost is using the discovered Python ok: [localhost] interpreter at /usr/bin/python3.13, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible- core/2.18/reference_appendices/interpreter_discovery.html for more information. https://docs.ansible.com/ansible-core/2.18/reference_appendices/ interpreter_discovery.html In addition, this allows setting a custom interpreter if a specific distribution requires it, such as NixOS: [1] https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html https://docs.ansible.com/ansible/latest/reference_appendices/config.html#interpreter-python [2] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#interpreter-python-fallback To: Daniel Gomez To: Luis Chamberlain Cc: kdevops@lists.linux.dev Cc: Daniel Gomez Signed-off-by: Daniel Gomez Reviewed-by: Luis Chamberlain --- Daniel Gomez (2): ansible_cfg: add python interpreter support Makefile: remove ansible_python_interpreter Makefile | 2 - Makefile.build_qemu | 4 -- Makefile.hypervisor-tunings | 1 - Makefile.kdevops | 21 +++---- Makefile.linux-mirror | 2 - Makefile.postfix | 1 - kconfigs/Kconfig.ansible_cfg | 64 ++++++++++++++++++++++ playbooks/roles/ansible_cfg/defaults/main.yml | 1 + .../roles/ansible_cfg/templates/ansible.cfg.j2 | 1 + scripts/archive.Makefile | 1 - scripts/dynamic-pci-kconfig.Makefile | 3 +- scripts/guestfs.Makefile | 14 ++--- scripts/install-menuconfig-deps.Makefile | 1 - scripts/journal-server.Makefile | 3 +- scripts/kconfig-ansible.Makefile | 1 + scripts/systemd-timesync.Makefile | 3 +- scripts/terraform.Makefile | 8 +-- scripts/vagrant.Makefile | 6 +- 18 files changed, 86 insertions(+), 51 deletions(-) --- base-commit: 41edfaca90249f4e7bd975a906f64340460d3dbf change-id: 20250402-python-interpreter-cbb06a40c8ff Best regards, diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index 0c29300..9172e42 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -116,7 +116,7 @@ menu "Ansible Python Interpreter" choice prompt "Ansible Python Interpreter" default ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO if !ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI - default ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM if ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI + default ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM if ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI || DISTRO_NIXOS config ANSIBLE_CFG_INTERPRETER_PYTHON_AUTO bool "Ansible Python Interpreter: Auto" @@ -151,6 +151,7 @@ config ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM_NAME string "Custom Ansible Python Interpreter Name" default $(shell, ./scripts/append-makefile-vars.sh $(ANSIBLE_CFG_INTERPRETER_PYTHON)) if ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI default "/usr/bin/python3" if !ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI + default "/usr/local/env python3" if !ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI && DISTRO_NIXOS endif # ANSIBLE_CFG_INTERPRETER_PYTHON_CUSTOM