Skip to content

Commit

Permalink
Add details on host groups (#2685)
Browse files Browse the repository at this point in the history
* Define host group settings persistance
* Edit host group settings hierarchy and priorities
* Split host group settings into a separate module
* Split host group-related modules into a separate assembly

---------

Co-authored-by: Jeremy Lenz <jlenz@redhat.com>
Co-authored-by: Shimon Shtein <sshtein@redhat.com>
  • Loading branch information
3 people authored Jan 26, 2024
1 parent a41c1a8 commit a986bbe
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 34 deletions.
8 changes: 0 additions & 8 deletions guides/common/assembly_administering-hosts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ include::modules/proc_changing-the-module-stream-for-a-host.adoc[leveloffset=+1]

include::modules/proc_enabling-custom-repositories-on-content-hosts.adoc[leveloffset=+1]

include::modules/proc_creating-a-host-group.adoc[leveloffset=+1]

include::modules/proc_creating-a-host-group-for-each-lifecycle-environment.adoc[leveloffset=+1]

include::modules/proc_adding-a-host-to-a-host-group.adoc[leveloffset=+1]

include::modules/proc_changing-the-host-group-of-a-host.adoc[leveloffset=+1]

ifdef::katello,satellite,orcharhino[]
include::modules/proc_adding-a-host-to-a-host-collection.adoc[leveloffset=+1]

Expand Down
11 changes: 11 additions & 0 deletions guides/common/assembly_working-with-host-groups.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include::modules/con_working-with-host-groups.adoc[]

include::modules/con_host-group-settings-and-nested-host-groups.adoc[leveloffset=+1]

include::modules/proc_creating-a-host-group.adoc[leveloffset=+1]

include::modules/proc_creating-a-host-group-for-each-lifecycle-environment.adoc[leveloffset=+1]

include::modules/proc_adding-a-host-to-a-host-group.adoc[leveloffset=+1]

include::modules/proc_changing-the-host-group-of-a-host.adoc[leveloffset=+1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[id="Host_Group_Settings_and_Nested_Host_Groups_{context}"]
= Host Group Settings and Nested Host Groups

A host group can define many settings for hosts, such as Lifecycle Environment, Content View, or Ansible roles that are available to the hosts.

IMPORTANT: When you change the settings of an existing host group, the new settings do not propagate to the hosts assigned to the host group.
Only Puppet class settings get updated on hosts after you change them in the host group.

You can create a hierarchy of host groups.
Aim to have one base level host group that represents all hosts in your organization and provides general settings, and then nested groups that provide specific settings.

{Project} applies host settings in the following order when nesting host groups:

* Host settings take priority over host group settings.
* Nested host group settings take priority over parent host group settings.

.Nested Host Group Hierarchy
====
You create a top-level host group named *Base* and two nested host groups named *Webserver* and *Storage*.
The nested host groups are associated with multiple hosts.
You also create host `custom.example.com` that is not associated with any host group.
You define the operating system on the top-level host group (*Base*) and Ansible roles on the nested host groups (*Webservers* and *Storage*).
[cols="1,1,1,2"]
|===
|Top-level host group |Nested host group |Hosts |Settings inherited from host groups
.4+|*Base*
This host group applies the `{EL}{nbsp}8.8` operating system setting.
// Rows related to Webservers
.2+|*Webservers*
This host group applies the `linux-system-roles.selinux` Ansible role.
|*webserver1.example.com*
.2+a|Hosts use the following settings:
* `{EL}{nbsp}8.8` defined by host group *Base*
* `linux-system-roles.selinux` defined by host group *Webservers*
|*webserver2.example.com*
// Rows related to Storage
.2+|*Storage*
This host group applies the `linux-system-roles.postfix` Ansible role.
|*storage1.example.com*
.2+a|Hosts use the following settings:
* `{EL}{nbsp}8.8` defined by host group *Base*
* `linux-system-roles.postfix` defined by host group *Storage*
|*storage2.example.com*
// Row related to No host group
2+|[No host group]
|*custom.example.com*
|No settings inherited from host groups.
|===
====

.Nested Host Group Settings
====
You create a top-level host group named *Base* and two nested host groups named *Webserver* and *Storage*.
You also create host `custom.example.com` that is associated with the top-level host group *Base*, but no nested host group.
You define different values for the operating system and Ansible role settings on the top-level host group (*Base*) and nested host groups (*Webserver* and *Storage*).
[cols="1,1,1,2"]
|===
|Top-level host group |Nested host group |Host |Settings inherited from host groups
.5+a|*Base*
This host group applies these settings:
* The `{EL}{nbsp}8.8` operating system
* The `linux-system-roles.selinux` Ansible role
// Rows related to Webservers
.2+a|*Webservers*
This host group applies these settings:
* The `{EL}{nbsp}8.9` operating system
* No Ansible role
|*webserver1.example.com*
.2+a|Hosts use the following settings:
* The `{EL}{nbsp}8.9` operating system from host group *Webservers*
* The `linux-system-roles.selinux` Ansible role from host group *Base*
|*webserver2.example.com*
// Rows related to Storage
.2+a|*Storage*
This host group applies these settings:
* No operating system
* The `linux-system-roles.postfix` Ansible role
|*storage1.example.com*
.2+a|Hosts use the following settings:
* The `{EL}{nbsp}8.8` operating system from host group *Base*
* The `linux-system-roles.postfix` Ansible role from host group *Storage*
|*storage2.example.com*
// Row related to custom.example.com
|[No nested host group]
|*custom.example.com*
a|Host uses the following settings:
* The `{EL}{nbsp}8.8` operating system from host group *Base*
* The `linux-system-roles.selinux` Ansible role from host group *Base*
|===
====

6 changes: 6 additions & 0 deletions guides/common/modules/con_working-with-host-groups.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[id="Working_with_Host_Groups_{context}"]
= Working with Host Groups

A host group acts as a template for common host settings.
Instead of defining the settings individually for each host, use host groups to define common settings once and apply them to multiple hosts.

27 changes: 1 addition & 26 deletions guides/common/modules/proc_creating-a-host-group.adoc
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
[id="Creating_a_Host_Group_{context}"]
= Creating a Host Group

If you create a high volume of hosts, many of the hosts can have common settings and attributes.
Adding these settings and attributes for every new host is time consuming.
If you use host groups, you can apply common attributes to hosts that you create.

A host group functions as a template for common host settings, containing many of the same details that you provide to hosts.
When you create a host with a host group, the host inherits the defined settings from the host group.
You can then provide additional details to individualize the host.
Create a host group to be able to apply host settings to multiple hosts.

To use the CLI instead of the {ProjectWebUI}, see the xref:cli-creating-a-host-group_{context}[].

.Host Group Hierarchy
You can create a hierarchy of host groups.
Aim to have one base level host group that represents all hosts in your organization and provide general settings, and then nested groups to provide specific settings.
For example, you can have a base level host group that defines the operating system, and two nested host groups that inherit the base level host group:

* *Hostgroup:* `Base` ({EL} 8.8)
** *Hostgroup:* `Webserver` (applies the `nginx` Puppet class)
*** *Host:* `webserver1.example.com` (web server)
*** *Host:* `webserver2.example.com` (web server)
** *Hostgroup:* `Storage` (applies the `nfs` Puppet class)
*** *Host:* `storage1.example.com` (storage server)
*** *Host:* `storage2.example.com` (storage server)
** *Host:* `custom.example.com` (custom host)

In this example, all hosts use {RHEL} 7.6 as their operating system because of their inheritance of the `Base` host group.
The two web server hosts inherit the settings from the `Webserver` host group, which includes the `nginx` Puppet class and the settings from the `Base` host group.
The two storage servers inherit the settings from the `Storage` host group, which includes the `nfs` Puppet class and the settings from the `Base` host group.
The custom host only inherits the settings from the `Base` host group.

.Procedure
. In the {ProjectWebUI}, navigate to *Configure* > *Host Groups* and click *Create Host Group*.
. If you have an existing host group that you want to inherit attributes from, you can select a host group from the *Parent* list.
Expand Down
2 changes: 2 additions & 0 deletions guides/doc-Managing_Hosts/master.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ include::common/modules/con_overview-of-hosts.adoc[leveloffset=+1]

include::common/assembly_administering-hosts.adoc[leveloffset=+1]

include::common/assembly_working-with-host-groups.adoc[leveloffset=+1]

include::common/assembly_registering-hosts.adoc[leveloffset=+1]

include::common/assembly_managing-network-interfaces.adoc[leveloffset=+1]
Expand Down

0 comments on commit a986bbe

Please sign in to comment.