[PATCH 05/12] gen-hosts: convert python interpreter vars to Kconfig

Daniel Gomez <[email protected]> Thu, 06 Nov 2025 23:35:59 +0100
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

Python interpreter variables use the old Makefile system to export
variables to the extra_vars.yaml. Leverage the output yaml option from
Kconfig to automatically get them into the extra_vars.yaml through
.extra_vars_auto.yaml.

These variables are behind KDEVOPS_ANSIBLE_PROVISION_ENABLE conditional
in Kconfig.ansible_provisioning. In the case where this is false, Python
interpreter variables will not be extracted to the yaml file. In that
case, use the current playbook defaults variables which matches the
same value configured in Kconfig.

Signed-off-by: Daniel Gomez <[email protected]>
---
 kconfigs/Kconfig.ansible_provisioning | 2 ++
 scripts/gen-hosts.Makefile            | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kconfigs/Kconfig.ansible_provisioning b/kconfigs/Kconfig.ansible_provisioning
index 93cc395f..7f20d092 100644
--- a/kconfigs/Kconfig.ansible_provisioning
+++ b/kconfigs/Kconfig.ansible_provisioning
@@ -104,6 +104,7 @@ config HAVE_DISTRO_PREFERS_ANSIBLE_PYTHON2
 
 config KDEVOPS_PYTHON_INTERPRETER
 	string "Which default python interpreter to use"
+	output yaml
 	default "/usr/bin/python2" if HAVE_DISTRO_PREFERS_ANSIBLE_PYTHON2
 	default "/usr/bin/python3" if !HAVE_DISTRO_PREFERS_ANSIBLE_PYTHON2
 	help
@@ -118,6 +119,7 @@ config KDEVOPS_PYTHON_INTERPRETER
 
 config KDEVOPS_PYTHON_OLD_INTERPRETER
 	string "Which python interpreter to use for old systems"
+	output yaml
 	default "/usr/bin/python2"
 	help
 	  The default python interpreter may be python3 but we need something
diff --git a/scripts/gen-hosts.Makefile b/scripts/gen-hosts.Makefile
index c809b1da..138bfbfd 100644
--- a/scripts/gen-hosts.Makefile
+++ b/scripts/gen-hosts.Makefile
@@ -16,8 +16,6 @@ GENHOSTS_EXTRA_ARGS += kdevops_hosts_template_full_path='$(KDEVOPS_HOSTS_TEMPLAT
 
 GENHOSTS_EXTRA_ARGS += kdevops_playbooks_dir_full_path='$(KDEVOPS_PLAYBOOKS_DIR_FULL_PATH)'
 GENHOSTS_EXTRA_ARGS += kdevops_genhosts_templates_dir='$(KDEVOPS_HOSTS_TEMPLATE_DIR)'
-GENHOSTS_EXTRA_ARGS += kdevops_python_interpreter='$(CONFIG_KDEVOPS_PYTHON_INTERPRETER)'
-GENHOSTS_EXTRA_ARGS += kdevops_python_old_interpreter='$(CONFIG_KDEVOPS_PYTHON_OLD_INTERPRETER)'
 ifeq (y,$(CONFIG_KDEVOPS_BASELINE_AND_DEV))
 GENHOSTS_EXTRA_ARGS += kdevops_baseline_and_dev='True'
 endif

-- 
2.51.0