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

Opt in to RH insights #3288

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

maximiliankolb
Copy link
Contributor

What changes are you introducing?

add procedure to opt-in to uploading reports to RH cloud.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

on orcharhino, users register hosts with RHEL and non-RHEL OS, but they should only set the parameter for RHEL OS.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.12/Katello 4.14 (Satellite 6.16)
  • Foreman 3.11/Katello 4.13
  • Foreman 3.10/Katello 4.12
  • Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9/6.10)
  • Foreman 3.8/Katello 4.10
  • Foreman 3.7/Katello 4.9 (Satellite 6.14)
  • Foreman 3.6/Katello 4.8
  • Foreman 3.5/Katello 4.7 (Satellite 6.13; orcharhino 6.6/6.7)
  • We do not accept PRs for Foreman older than 3.5.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this reads well and from a technical point of view I'd say ACK.

Copy link
Contributor Author

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to "master" and applied all feedback. In general, I question the hint about all the levels to set the parameter. If we mentation "yes, you can set it globally/for this subnet", then we do not really focus on the fact that it's supposed to differ on an per-OS level, namely RHEL and non-RHEL OS.

Ready for re-review.

@ekohl
Copy link
Member

ekohl commented Sep 19, 2024

In general, I question the hint about all the levels to set the parameter. If we mentation "yes, you can set it globally/for this subnet", then we do not really focus on the fact that it's supposed to differ on an per-OS level, namely RHEL and non-RHEL OS.

To me it feels a bit redundant if you understand how host parameters work. I don't know if we have a documentation section on it. I don't think we do, but IMHO we should have something like that. Then you can refer to it.

@maximiliankolb
Copy link
Contributor Author

In general, I question the hint about all the levels to set the parameter. If we mentation "yes, you can set it globally/for this subnet", then we do not really focus on the fact that it's supposed to differ on an per-OS level, namely RHEL and non-RHEL OS.

To me it feels a bit redundant if you understand how host parameters work. I don't know if we have a documentation section on it. I don't think we do, but IMHO we should have something like that. Then you can refer to it.

We have a list in the Provisioning Hosts guide: https://docs.theforeman.org/nightly/Provisioning_Hosts/index-katello.html#Host_Parameter_Hierarchy_provisioning

@ekohl Are you OK with removing the sentence about "you can also set this on level X" in both procedures and instead refer users to this reference?

@ekohl
Copy link
Member

ekohl commented Sep 19, 2024

@ekohl Are you OK with removing the sentence about "you can also set this on level X" in both procedures and instead refer users to this reference?

Yes, that's what I was looking for.

I do see it says:

You can access host parameters when provisioning hosts

Host parameters are indeed used when provisioning hosts, but also in other cases. The ENC as used by Puppet comes to mind, but also REX and here with RH cloud.

Perhaps you can broaden that sentence?

Edit: I was looking for this in the Administrating hosts guide and couldn't find it. Perhaps out of scope for this PR, but should it be moved?

Copy link
Contributor Author

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to "master", reworked commits, and added a reference to host parameter hierarchy.

Issue to eventually move the placement of the host parameter hierarchy: #3302

Ready for re-review.

@maximiliankolb maximiliankolb added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective labels Sep 20, 2024
Copy link

@sbernhard sbernhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@maximiliankolb maximiliankolb added tech review done No issues from the technical perspective and removed Needs tech review Requires a review from the technical perspective labels Sep 30, 2024
Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the original module you've based it on was a mess. Perhaps this would be an opportunity to improve it as well?

@pr-processor pr-processor bot added the Waiting on contributor Requires an action from the author label Oct 2, 2024
@pr-processor pr-processor bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Oct 4, 2024
Copy link
Contributor Author

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to "master" and applied most feedback. Rewriting "excluding hosts from RH Insights" is out of scope, but I can make further minor adjustments.

Copy link
Member

@asteflova asteflova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for resolving my suggestions. Lena's comment threads are open so I'll pass the review to her.

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a sanity check in the web UI and we need to make a couple of adjustments.

ifdef::katello,foreman-el,foreman-deb[]
Red Hat Insights is a service by Red Hat for {RHEL} hosts.
Ensure to set this parameter for {RHEL} hosts only.
If you set the parameter on any non-{RHEL} operating systems, it automatically uploads new reports to the {RHCloud}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you set the parameter on any non-{RHEL} operating systems, it automatically uploads new reports to the {RHCloud}.
If you set the parameter on any non-{RHEL} operating systems, {Project} automatically uploads new reports to the {RHCloud}.

This line seems confusing to me.

Does it mean that Foreman will be able to install Insights client on Debian/Ubuntu for example? If not, are the reports even generated? Is the host still included in the inventory upload? If not, then what is there to upload?
cc @chris1984 @jeremylenz Can you please help answer these questions? ^^

Also, it depends on the Inventory Upload setting whether Foreman uploads the inventory data automatically or not. It isn't hard coded.
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Insights client will not be installed on Debian / Ubuntu since the corresponding snippet has a verification if the host is running RHEL.

For the inventory upload, however, Foreman RH-Cloud searches for hosts with the parameter host_registration_insights != false independent of the fact when the parameter was actually set or if the insights client is indeed installed.

The facts it uploads to RH Hybrid Cloud Console like the (potentially obfuscated) IP address, hostname seem to be taken from the Foreman database since in our tests they appear in the inventory in RH HCC even for Debian or Ubuntu hosts.

The query loading the host information is in lib/foreman_inventory_upload/generators/queries.rb inside the rh-cloud plugin if somebody wants to have a closer look.

As far as I understand {Project} uploads an insights report if one is available and a base set of facts whereof IP and hostname can be obfuscated and packages can be excluded. The latter is not relevant for Debian or Ubuntu since they have deb_packages instead of packages.

I hope that helps in finding a wording for that line and answering your questions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied Lena's suggestion.

@pr-processor pr-processor bot added the Waiting on contributor Requires an action from the author label Oct 7, 2024
This makes Vale happy.
Copy link
Contributor Author

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to "master" and applied all feedback. Kindly asking for a re-review.

ifdef::katello,foreman-el,foreman-deb[]
Red Hat Insights is a service by Red Hat for {RHEL} hosts.
Ensure to set this parameter for {RHEL} hosts only.
If you set the parameter on any non-{RHEL} operating systems, it automatically uploads new reports to the {RHCloud}.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied Lena's suggestion.

@pr-processor pr-processor bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Oct 7, 2024
@pr-processor pr-processor bot added Waiting on contributor Requires an action from the author and removed Needs re-review labels Oct 7, 2024
Keep opt-out for Satellite; show opt-in procedure for non-Satellite
builds.

* Add reference to host parameter hierarchy
* Drop trailing colon before procedure
* Enable RH Insights for RHEL hosts only for upstream
* Remove self-referential sentence
* Rephrase introduction to enabling RH Insights
* Reworded additional resources
* Use active voice
@pr-processor pr-processor bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Oct 7, 2024
Copy link
Contributor Author

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied both suggestions by Lena.

Copy link
Contributor

@Lennonka Lennonka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@maximiliankolb maximiliankolb merged commit 8986a6d into theforeman:master Oct 8, 2024
9 checks passed
@maximiliankolb maximiliankolb deleted the opt_in_to_rh_insights branch October 8, 2024 07:08
@maximiliankolb maximiliankolb added style review done No issues from docs style/grammar perspective and removed Needs style review Requires a review from docs style/grammar perspective labels Oct 8, 2024
@maximiliankolb
Copy link
Contributor Author

Merged to "master" and cherry-picked:
bd9d5c7..1f88c99 3.12 -> 3.12
1959055..0373afc 3.11 -> 3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style review done No issues from docs style/grammar perspective tech review done No issues from the technical perspective
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants