Skip to content

Commit 4143496

Browse files
Deduplicate content to apply errata to hosts (#4181)
* Fix tripple dashes in command option * Deduplicate content to apply errata to a host Applying errata directly via Hammer CLI is deprecated: $ hammer host errata --help ... Subcommands: apply Not supported. Use the remote execution equivalent `hammer job-invocation create --feature katello_errata_install`. * Fix WebUI procedure to create a CV filter for errata Tested this procedure on Foreman 3.15/Katello 4.17; it also affects Foreman 3.14/Katello 4.16. Free bonus: the module does no longer mention a specific Client OS content type -> It now works for all Client OS. This was due to a renamed button in the WebUI. * Split WebUI and CLI procedures to create CV filters for errata Refs DITA migration * Unify CV filters for Deb and Yum content * Fix procedure to create CV filters via WebUI Button in the WebUI: * Deb: Add DEB rule * Yum: Add RPM rule By default, all flavours will show "Add RPM rule" based on an attribute. This is required to adjust the procedure in downstream docs. Tested on Foreman 3.14/Katello 4.16. * Rework WebUI navigation to apply installable errata * Fix procedure to apply installable errata via WebUI * Use example values for Hammer CLI command * Drop module applying errata to host collection Keep search query as part of a different module for CLI. * Combine errata to a host and errata to multiple hosts We can merge the two (times two) modules because they only differ in their search query. * Drop superfluous module proc_applying-installable-errata-by-using-web-ui.adoc * Drop list of filter combinations for CV filters * Use DocURL link because module is part of two guides * Reword package filters
1 parent 66ef56b commit 4143496

22 files changed

+195
-472
lines changed

guides/common/assembly_configuring-host-collections.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ include::modules/proc_adding-errata-to-a-host-collection.adoc[leveloffset=+2]
3030

3131
include::modules/proc_adding-errata-to-a-host.adoc[leveloffset=+2]
3232

33-
include::modules/proc_applying-installable-errata.adoc[leveloffset=+2]
33+
include::modules/proc_applying-errata-to-hosts-by-using-web-ui.adoc[leveloffset=+2]
3434

3535
include::modules/proc_filter-errata-by-type-severity.adoc[leveloffset=+2]
3636

guides/common/assembly_managing-content-views.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ include::modules/proc_enabling-dependency-solving-for-a-content-view.adoc[levelo
3636

3737
include::modules/con_content-filter-examples.adoc[leveloffset=+1]
3838

39-
include::modules/proc_creating-a-content-filter-for-yum-content.adoc[leveloffset=+1]
39+
include::modules/proc_creating-a-content-view-filter-by-using-web-ui.adoc[leveloffset=+1]
4040

41-
ifndef::satellite[]
42-
include::modules/proc_creating-a-content-filter-for-deb-content.adoc[leveloffset=+1]
43-
endif::[]
41+
include::modules/proc_creating-a-content-view-filter-by-using-cli.adoc[leveloffset=+1]
4442

4543
include::modules/proc_deleting-multiple-content-view-versions.adoc[leveloffset=+1]
4644

guides/common/assembly_managing-errata.adoc

Lines changed: 5 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ include::modules/proc_inspecting-available-errata.adoc[leveloffset=+1]
88

99
include::modules/ref_parameters-available-for-errata-search.adoc[leveloffset=+1]
1010

11-
include::modules/proc_applying-installable-errata.adoc[leveloffset=+1]
12-
1311
include::modules/proc_running-custom-code-while-applying-errata.adoc[leveloffset=+1]
1412

1513
include::modules/con_subscribing-to-errata-notifications.adoc[leveloffset=+1]
@@ -18,7 +16,9 @@ include::modules/con_subscribing-to-errata-notifications.adoc[leveloffset=+1]
1816
include::modules/con_limitations-to-repository-dependency-resolution.adoc[leveloffset=+1]
1917
:!package-manager:
2018

21-
include::modules/proc_creating-a-content-view-filter-for-errata.adoc[leveloffset=+1]
19+
include::modules/proc_creating-a-content-view-filter-for-errata-by-using-web-ui.adoc[leveloffset=+1]
20+
21+
include::modules/proc_creating-a-content-view-filter-for-errata-by-using-cli.adoc[leveloffset=+1]
2222

2323
include::modules/proc_adding-errata-to-an-incremental-content-view.adoc[leveloffset=+1]
2424

@@ -28,102 +28,6 @@ endif::[]
2828

2929
include::modules/con_applying-errata-to-hosts.adoc[leveloffset=+1]
3030

31-
ifndef::satellite[]
32-
:os_name: AlmaLinux
33-
:os_name_anchor: {os_name}
34-
:os_major: 9
35-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
36-
37-
:os_name: AlmaLinux
38-
:os_name_anchor: {os_name}
39-
:os_major: 8
40-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
41-
42-
:os_name: CentOS
43-
:os_name_anchor: {os_name}
44-
:os_major: 7
45-
:os_major_anchor: {os_major}
46-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
47-
endif::[]
48-
49-
ifdef::orcharhino[]
50-
:os_name: Debian
51-
:os_name_anchor: {os_name}
52-
:os_major: 11
53-
:os_major_anchor: {os_major}
54-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
55-
56-
:os_name: Debian
57-
:os_name_anchor: {os_name}
58-
:os_major: 10
59-
:os_major_anchor: {os_major}
60-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
61-
endif::[]
62-
63-
ifndef::satellite[]
64-
:os_name: Oracle Linux
65-
:os_name_anchor: Oracle_Linux
66-
:os_major: 9
67-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
68-
69-
:os_name: Oracle Linux
70-
:os_name_anchor: Oracle_Linux
71-
:os_major: 8
72-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
73-
endif::[]
74-
75-
:os_name: {RHEL}
76-
:os_name_anchor: Red_Hat_Enterprise_Linux
77-
:os_major: 10
78-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
79-
80-
:os_name: {RHEL}
81-
:os_name_anchor: Red_Hat_Enterprise_Linux
82-
:os_major: 9
83-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
84-
85-
:os_name: {RHEL}
86-
:os_name_anchor: Red_Hat_Enterprise_Linux
87-
:os_major: 8
88-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
89-
90-
:os_name: {RHEL}
91-
:os_name_anchor: Red_Hat_Enterprise_Linux
92-
:os_major: 7
93-
include::modules/proc_applying-errata-to-hosts-el7.adoc[leveloffset=+2]
94-
95-
ifndef::satellite[]
96-
:os_name: Rocky Linux
97-
:os_name_anchor: Rocky_Linux
98-
:os_major: 9
99-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
100-
101-
:os_name: Rocky Linux
102-
:os_name_anchor: Rocky_Linux
103-
:os_major: 8
104-
include::modules/proc_applying-errata-to-hosts-el.adoc[leveloffset=+2]
105-
106-
:os_name: SUSE Linux Enterprise Server
107-
:os_name_anchor: SUSE_Linux_Enterprise_Server
108-
:os_major: 15
109-
:os_major_anchor: {os_major}
110-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
111-
endif::[]
112-
113-
ifdef::orcharhino[]
114-
:os_name: Ubuntu
115-
:os_name_anchor: {os_name}
116-
:os_major: 22.04
117-
:os_major_anchor: 22_04
118-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
119-
120-
:os_name: Ubuntu
121-
:os_name_anchor: {os_name}
122-
:os_major: 20.04
123-
:os_major_anchor: 20_04
124-
include::modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc[leveloffset=+2]
125-
endif::[]
126-
127-
include::modules/proc_applying-errata-to-multiple-hosts.adoc[leveloffset=+1]
31+
include::modules/proc_applying-errata-to-hosts-by-using-web-ui.adoc[leveloffset=+1]
12832

129-
include::modules/proc_applying-errata-to-a-host-collection.adoc[leveloffset=+1]
33+
include::modules/proc_applying-errata-to-hosts-by-using-cli.adoc[leveloffset=+1]

guides/common/attributes-base.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
:client-debian-installation-medium-path: http://deb.debian.org/debian/
175175
:client-installation-medium-path: download.example.com/{client-installation-medium}/$version/Server/$arch/os/
176176
:client-clevis-repository: AppStream
177+
:client-cv-filter: RPM
177178
:client-os-family-hammer: Redhat
178179
:client-os-family: Red Hat
179180
:client-os: {EL}

guides/common/modules/con_applying-errata-to-hosts.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:_mod-docs-content-type: CONCEPT
22

3-
[id="Applying_Errata_to_Hosts_{context}"]
3+
[id="applying-errata-to-hosts"]
44
= Applying errata to hosts
55

66
Use these procedures to review and apply errata to hosts.
@@ -14,5 +14,3 @@ endif::[]
1414
For more information, see {ManagingHostsDocURL}Registering_Hosts_by_Using_Global_Registration_managing-hosts[Registering hosts by using global registration] in _{ManagingHostsDocTitle}_.
1515
* Configure the host for remote execution.
1616
For more information about running remote execution jobs, see {ManagingHostsDocURL}Configuring_and_Setting_Up_Remote_Jobs_managing-hosts[Configuring and Setting Up Remote Jobs] in _{ManagingHostsDocTitle}_.
17-
18-
The procedure to apply an erratum to a host depends on its operating system.

guides/common/modules/proc_adding-errata-to-an-incremental-content-view.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ You can add more IDs in a comma-separated list.
4242
[options="nowrap" subs="+quotes"]
4343
----
4444
$ hammer content-view version incremental-update \
45-
--content-view-version-id 319 --errata-ids 34068b
45+
--content-view-version-id _My_Content_View_Version_ID_ \
46+
--errata-ids _My_Erratum_ID_1_,_My_Erratum_ID_2_
4647
----

guides/common/modules/proc_applying-errata-to-a-host-collection.adoc

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="applying-errata-to-hosts-by-using-cli"]
4+
= Applying errata to hosts by using CLI
5+
6+
You can use Hammer CLI to review and apply errata to hosts.
7+
8+
.Procedure
9+
. List all errata:
10+
+
11+
[options="nowrap", subs="+quotes,verbatim,attributes"]
12+
----
13+
$ hammer erratum list --organization "_My_Organization_"
14+
----
15+
+
16+
You can limit the output to applicable by adding `--errata-restrict-applicable` or to installable errata by adding `--errata-restrict-installable`.
17+
. Optional: View information of an erratum:
18+
+
19+
[options="nowrap", subs="+quotes,verbatim,attributes"]
20+
----
21+
$ hammer erratum info --id _My_Erratum_ID_
22+
----
23+
. Apply errata to your hosts.
24+
+
25+
You can use `Remote Execution`:
26+
+
27+
[options="nowrap", subs="+quotes,verbatim,attributes"]
28+
----
29+
$ hammer job-invocation create \
30+
--feature katello_errata_install \
31+
--inputs errata=_My_Erratum_ID_1_,_My_Erratum_ID_2_ \
32+
--search-query "name = host.example.com"
33+
----
34+
+
35+
If you want to apply errata to all hosts in a host collection, use `"host_collection = _My_Host_Collection_Name_"` as the search query.
36+
If you want to apply a specific erratum to all hosts, use `"applicable_errata = _My_Erratum_ID_"` as the search query.
37+
+
38+
You can use a Bash script that applies an erratum to each host for which this erratum is available:
39+
+
40+
[source, terminal, options="nowrap", subs="+quotes,verbatim,attributes"]
41+
----
42+
for HOST in `hammer --csv --csv-separator "|" host list --search "applicable_errata = _My_Erratum_ID_" --organization "_My_Organization_" | tail -n+2 | awk -F "|" '{ print $2 }'` ;
43+
do
44+
echo "== Applying to $HOST ==" ; hammer job-invocation create --feature katello_errata_install --search-query "name = $HOST" --inputs errata=_My_Erratum_ID_1_,_My_Erratum_ID_2_ ;
45+
done
46+
----
47+
+
48+
This command identifies all hosts with _My_Erratum_ID_ as an applicable erratum and then applies the erratum to each host.
49+
50+
.Verification
51+
. Locate the task ID of your errata application in task listing:
52+
+
53+
[options="nowrap" subs="verbatim,quotes"]
54+
----
55+
$ hammer task list
56+
----
57+
. Inspect the state of the selected task:
58+
+
59+
[options="nowrap" subs="+quotes"]
60+
----
61+
$ hammer task progress --id _My_Task_ID_
62+
----
63+
64+
.Additional resources
65+
* {AdministeringDocURL}Building_Search_Queries_admin[Building search queries] in _{AdministeringDocTitle}_
66+
* `hammer erratum list --help`
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="applying-errata-to-hosts-by-using-web-ui"]
4+
= Applying errata to hosts by using {ProjectWebUI}
5+
6+
You can use {ProjectWebUI} to review and apply errata to hosts.
7+
8+
.Prerequisites
9+
* Synchronize {ProjectName} repositories with the latest errata available from Red{nbsp}Hat.
10+
For more information, see {ContentManagementDocURL}Synchronizing_Repositories_content-management[Synchronizing repositories] in _{ContentManagementDocTitle}_.
11+
* Register the hosts to an environment and content view on {ProjectServer}.
12+
For more information, see {ManagingHostsDocURL}Registering_Hosts_by_Using_Global_Registration_managing-hosts[Registering hosts by using global registration] in _{ManagingHostsDocTitle}_.
13+
* Configure the host for remote execution.
14+
For more information about running remote execution jobs, see {ManagingHostsDocURL}Configuring_and_Setting_Up_Remote_Jobs_managing-hosts[Configuring and setting up remote jobs] in _{ManagingHostsDocTitle}_.
15+
16+
.Procedure
17+
. In the {ProjectWebUI}, navigate to *Content* > *Content Types* > *Errata*.
18+
. Click the name of an erratum you want to apply.
19+
. On the to *Content Hosts* tab, select all hosts that you want to apply errata to.
20+
. Click *Apply to Hosts* and click *Confirm*.
21+
22+
.Verification
23+
. In the {ProjectWebUI}, navigate to *Monitor* > *Jobs*.
24+
. Select the most recent `Install errata` job.
25+
. Verify that the remote execution to apply errata to all selected host succeeded.

guides/common/modules/proc_applying-errata-to-hosts-centos7-debian-sles-ubuntu.adoc

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)