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

Add 'rhc id' subcommand #13

Open
subpop opened this issue Aug 1, 2022 · 4 comments
Open

Add 'rhc id' subcommand #13

subpop opened this issue Aug 1, 2022 · 4 comments

Comments

@subpop
Copy link
Collaborator

subpop commented Aug 1, 2022

A frequently asked question is "how do I get my RHC client ID?" Should we add a subcommand to rhc that just prints the client-id?

@omaciel
Copy link

omaciel commented Aug 1, 2022

👍🏻

@jirihnidek
Copy link
Contributor

What do you mean with the client ID? Is it content of /etc/insights-client/machine-id or output of subscription-manager identity?

@subpop
Copy link
Collaborator Author

subpop commented Sep 20, 2022

This would be the value used by the MQTT client to identify itself. When yggd is started, if the flag cert-file is present, the file is loaded as an x509 certificate and the CN value of the Subject DN is used as the client ID. For systems running yggd as rhcd (most RHEL hosts today), this is the same value as the output of subscription-manager identity because the value of cert-file is set to /etc/pki/consumer/cert.pem.

It is possible to run yggd without setting a cert-file flag, in which case yggd will generate a client ID value itself and write that value out to /var/lib/yggdrasil/client-id. In all cases, if cert-file is present, this value supersedes the internally generated client ID value. It is also possible to set an explicit client ID value by setting the client-id flag.

@subpop
Copy link
Collaborator Author

subpop commented Sep 20, 2022

Getting the yggd generated client ID value from rhc is a bit nuanced though. They're separate processes, and rhc has no knowledge of the yggd logic to determine client ID. So our approach here will require two steps:

  1. Until yggd has a proper D-Bus interface, rhc will probably have to naively assume that the subscription-manager consumer identity is the client ID.
  2. Once yggd has a proper D-Bus interface, rhc will be able to query yggd for its actual client ID.

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

3 participants