foreman-documentation icon indicating copy to clipboard operation
foreman-documentation copied to clipboard

Correct Debian package installation instructions

Open ekohl opened this issue 1 year ago • 4 comments

In fd8ed92fd762376cf0ae11e16b5e91b8280ec787 the package installation instructions were rewritten to use dnf, which isn't available. It now never uses the client-package-* attributes on servers, but instead relies on the package-manager attribute.

It also introduces an attribute for the NFS server package and uses the attribute for the bind utils package.

Fixes: fd8ed92fd762 ("Use attributes to manage pkgs on Hosts")

Please cherry-pick my commits into:

  • [x] Foreman 3.10/Katello 4.12
  • [x] Foreman 3.9/Katello 4.11 (planned Satellite 6.15)
  • [ ] 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)
  • [ ] Foreman 3.4/Katello 4.6 (EL8 only)
  • [ ] Foreman 3.3/Katello 4.5 on EL7 & EL8 (Satellite 6.12 on EL8 only; orcharhino 6.4/6.5 on EL8 only)
  • We do not accept PRs for Foreman older than 3.3.

ekohl avatar Apr 03 '24 17:04 ekohl

The PR preview for 4428562b0b888ed13ff76fc6d4d56b4414c8e7bc could not be generated

github-actions[bot] avatar Apr 03 '24 17:04 github-actions[bot]

This escalated a bit in size and it now removes more lines than it adds. Individual commits explain what's going on.

ekohl avatar Apr 04 '24 11:04 ekohl

Frist thoughts:

  • I think it's generally bad practice to set an attribute somewhere throughout the docs and never unset it. If it's relevant for all guides > guides/common/attributes*. If it's only relevant for a particular module, use "set, module, unset". (context: it was probably me who introduced this issue!)

  • I propose the following patch to fix this:

diff --git a/guides/common/modules/proc_configuring-repositories.adoc b/guides/common/modules/proc_configuring-repositories.adoc
index f8cbdb460d..0552d1e8fb 100644
--- a/guides/common/modules/proc_configuring-repositories.adoc
+++ b/guides/common/modules/proc_configuring-repositories.adoc
@@ -51,6 +51,7 @@ endif::[]
 ifdef::foreman-el,katello[]
 include::proc_configuring-repositories-el.adoc[]
 endif::[]
+:!package-manager:
 
 include::snip_step-verify-enabled-repolist.adoc[]
 
@@ -85,6 +86,7 @@ ifdef::foreman-el,katello[]
 include::proc_configuring-repositories-el.adoc[]
 endif::[]
 
+:!package-manager:
 include::snip_step-verify-enabled-repolist.adoc[]
 
 ifdef::foreman-el,katello,satellite[]

  • Alternatively, you could also replace "dnf" with "{package-manager}" in guides/common/modules/snip_step-verify-enabled-repolist.adoc and move unsetting the attribute two lines lower.

  • If unsetting attributes scattered throughout any modules breaks the build, I consider this a good thing. Then we're forced to rethink using this specific attribute some more!

  • guides/common/modules/proc_installing-server-packages-el.adoc appears to be unused. Is the PR missing an include? If not, please drop this file.

$ rg "proc_installing-server-packages"
$ rg "proc_installing-*-packages"
guides/common/assembly_managing-packages.adoc
8:include::modules/proc_installing-packages-on-a-host.adoc[leveloffset=+1]
  • There's a duplicate attribute in "guides/common/attributes-satellite.adoc".

maximiliankolb avatar Apr 05 '24 07:04 maximiliankolb

  • I think it's generally bad practice to set an attribute somewhere throughout the docs and never unset it. If it's relevant for all guides > guides/common/attributes*. If it's only relevant for a particular module, use "set, module, unset". (context: it was probably me who introduced this issue!)

Agreed, and I've tried to reduce that use here.

  • guides/common/modules/proc_installing-server-packages-el.adoc appears to be unused. Is the PR missing an include? If not, please drop this file.

I was sure I had a git rm somewhere along the way, but clearly it didn't end up in the PR.

ekohl avatar Apr 08 '24 10:04 ekohl