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

Implement elemental-register subcommands #832

Open
anmazzotti opened this issue Sep 4, 2024 · 0 comments
Open

Implement elemental-register subcommands #832

anmazzotti opened this issue Sep 4, 2024 · 0 comments

Comments

@anmazzotti
Copy link
Contributor

anmazzotti commented Sep 4, 2024

Currently elemental-register supports a multitude of arguments that can be used all together, even though they may be mutually exclusive. This makes the code a bit harder to maintain, and harder to extend as well with new functionality.

It would be best to split into subcommands.

elemental-register version
elemental-register register --install
elemental-register install 
elemental-register reset --network-only
elemental-register verify

Global args: --config, --state, --debug

Note that backward compatibility should be granted when running elemental-register root command.

Subcommands:

  • version Displays the version
  • register Registers this machine, if --install is used, installation will take place automatically after registration.
  • install Installs the OS on this machine.
  • reset Resets the machine. If --network-only is used, it will only reset the network (consider alternative network reset subcommand)
  • verify (NEW!) performs a simple verification (fetch the remote registration? also machineinventory authentication?) that can be used for boot assessment

I also propose to drop all other arguments that can be retrieved from the configuration file/remote registration, like emulate-tpm, no-smbios, ca-cert, auth, and so on).
--config should be enough as a global argument

--state is nice to have to be able to point to a state file without having to expose that in the MachineRegistration API, but I would also think about making the elemental-register stateless again. This can be simply achieved by dropping any emulated-tpm support, which will also improve maintenance and reduce complexity. We have alternative auth methods that can be equally used for non-production/demo purposes already.

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant