Re: [PATCH v3 2/3] declared_hosts: add support for pre-existing infrastructure
Daniel Gomez <[email protected]>
| Newsgroups | dev.linux.lists.kdevops |
|---|---|
| Organization | kernel.org |
| Message-ID | <[email protected]> |
On 03/09/2025 01.53, Luis Chamberlain wrote: > This adds support for using pre-existing infrastructure (bare metal servers, > pre-provisioned VMs, cloud instances) that users already have SSH access to, > bypassing the kdevops bringup process. > > We borrow the DECLARE_* foo practice from the Linux kernel to ensure the > user will declare the hosts they already have set up with: > > make DECLARE_HOSTS="foo bar" defconfig-foo > or > make DECLARE_HOSTS="foo bar" menuconfig > > We just skip the data partition setup, at the role level. The user > is encouraged to set DATA_PATH if they want something other than /data/ > to be expected to be used. The onus is on them to ensure that the > DATA_PATH works for the user the the host is configured to ssh access > to already. > > Currently no workflows are fully supported with declared hosts. > Each workflow requires individual review and testing to ensure proper > operation with pre-existing infrastructure before being enabled. > > Generated-by: Claude AI > Signed-off-by: Luis Chamberlain <[email protected]> > --- ... > diff --git a/kconfigs/Kconfig.declared_hosts b/kconfigs/Kconfig.declared_hosts > new file mode 100644 > index 00000000..cfdae8fa > --- /dev/null > +++ b/kconfigs/Kconfig.declared_hosts > @@ -0,0 +1,71 @@ > +# Configuration for declared hosts that skip bringup process > + > +config KDEVOPS_USE_DECLARED_HOSTS > + bool "Use declared hosts (skip bringup process)" > + select WORKFLOW_INFER_USER_AND_GROUP > + output yaml > + help > + Enable this option to use pre-existing hosts that you have already > + configured with SSH access. This is useful for: > + > + * Bare metal systems > + * Pre-provisioned VMs or cloud instances > + * Systems managed by other infrastructure tools > + > + When this option is enabled: > + - SSH keys will not be generated (assumes you already have access) > + - Bringup and teardown operations will be skipped > + - User and group settings will be inferred from the target hosts > + - You must provide the list of hosts in KDEVOPS_DECLARED_HOSTS > + > + This option automatically: > + - Selects WORKFLOW_INFER_USER_AND_GROUP to detect the correct > + user and group on the target systems > + - Assumes SSH access is already configured > + > +if KDEVOPS_USE_DECLARED_HOSTS > + > +config KDEVOPS_DECLARED_HOSTS > + string "List of declared hosts" > + output yaml > + default "$(shell, echo ${DECLARED_HOSTS})" > + default "" > + help > + Provide a list of hostnames or IP addresses for the pre-existing > + systems you want to use. These hosts must already be accessible > + via SSH with the appropriate keys configured. > + > + Format: Space or comma-separated list > + Example: "host1 host2 host3" or "host1,host2,host3" > + > + These hosts will be used directly without any bringup process. > + Make sure you have: > + - SSH access configured > + - Required packages installed > + - Appropriate user permissions > + > +config KDEVOPS_DECLARED_HOSTS_PYTHON_INTERPRETER > + string "Python interpreter path on declared hosts" > + default "/usr/bin/python3" > + output yaml > + help > + Specify the path to the Python interpreter on the declared hosts. > + This is required for Ansible to function properly. > + > + Common values: > + - /usr/bin/python3 (most modern systems) > + - /usr/bin/python (older systems) > + - /usr/local/bin/python3 (custom installations) Isn't this redundant? In the hosts template files, this patch does this: ansible_python_interpreter = "{{ kdevops_declared_hosts_python_interpreter | default(kdevops_python_interpreter) }}" I think, using the kdevops_python_interperter config/yaml directly should be sufficient. Or what I am missing?