Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label Templates: Hardware variables rework #834

Closed
2 tasks done
fgiudici opened this issue Sep 5, 2024 · 3 comments · Fixed by #843
Closed
2 tasks done

Label Templates: Hardware variables rework #834

fgiudici opened this issue Sep 5, 2024 · 3 comments · Fixed by #843
Assignees

Comments

@fgiudici
Copy link
Member

fgiudici commented Sep 5, 2024

The Hardware data collected during the host registration is altered before being sent to the Elemental Operator, in order to make it easier to consume.

Anyway, this wrapping process should be improved fixing the format of the data (e.g., ${CPU/Capabilities} is filled as a slice of strings, that fails to be rendered) and allowing to enumerate block and network devices without knowing their device name (which brings to some nonsense variables like ${System Data/Network/{Iface name}/Name}, where the rendered value is equal to what you have to put in the template as the {Iface name}).

This issue tracks:

  • fix the format of all the exported variables (output should always be a string)
  • add block and network device data retrieval without knowing their name

sibling doc issue: rancher/elemental-docs#374

@fgiudici fgiudici self-assigned this Sep 5, 2024
fgiudici added a commit to fgiudici/elemental-operator that referenced this issue Sep 5, 2024
'dumpdata' allows to inspect host data from the running host as they are
collected during the registration phase: those are the data made
available in the Elemental Label Templates feature.
This subcommand was developed while working at rancher#834 and since could be
handy for debugging and even for users (elemental sysadmins) adding it
to the elemental-register binary.

'version' is the very first step in moving the elemental-register flags
to command, as requested by rancher#832.

Related to issues: rancher#832, rancher#834

Signed-off-by: Francesco Giudici <[email protected]>
fgiudici added a commit that referenced this issue Sep 6, 2024
'dumpdata' allows to inspect host data from the running host as they are
collected during the registration phase: those are the data made
available in the Elemental Label Templates feature.
This subcommand was developed while working at #834 and since could be
handy for debugging and even for users (elemental sysadmins) adding it
to the elemental-register binary.

'version' is the very first step in moving the elemental-register flags
to command, as requested by #832.

Related to issues: #832, #834

Signed-off-by: Francesco Giudici <[email protected]>
@gervaso
Copy link

gervaso commented Sep 6, 2024

Hello, following this!
I would also suggest to make network interfaces mac addresses available as variables if possible.
Some existing existing use cases rely on the "primary" interface mac address to identify a device, basically basing the hostname on that.
We're currently testing elemental as a means to manage remote IoT devices which will run k3s, but so far we are having a hard time identifiying them once they register because unfortunately the OEM is not setting UUID, serial or SKU data in smbios and so all the hardware looks the same to the elemental operator.

@fgiudici
Copy link
Member Author

fgiudici commented Sep 9, 2024

Hey @gervaso 👋🏼
actually the MAC is already available also if not documented: you will anyway need to know the interface name to get it.
It would be:
${System Data/Network/{Iface name}/MacAddress}
where "{Iface name}" is the actual named interface. To be explicit, if the NIC on your system is 'eth0', the MAC would be available at:
${System Data/Network/eth0/MacAddress}

@gervaso
Copy link

gervaso commented Sep 9, 2024

Oh, this is a very useful piece of information I've been missing out. I'll put it to good use in a flash!
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants