이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 4. System Management
Red Hat Satellite provides system-level support and management of Red Hat Systems and networks of systems. This chapter will discuss systems and how to organize these systems into functional groups inside the organization for effective management.
4.1. Registering Systems to Satellite 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Systems are client machines that requests package updates from Red Hat Satellite. These systems can be physical machines or virtualized systems that have been configured to register and receive updates from the Satellite. Registering systems to Satellite is an important step, as the client system will, by default, register to Red Hat Network, instead of the organization's Satellite. For information about how to register, see the relevant chapter on registering clients to the Satellite server in the Red Hat Satellite Client Configuration Guide.
4.1.1. Using Red Hat Network Bootstrap to Register a System 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Network provides a tool that automates much of the manual reconfiguration for registering systems, this tool is called Red Hat Network Bootstrap. Red Hat Network Bootstrap plays an integral role in the Red Hat Satellite Server Installation Program, enabling generation of the bootstrap script during installation.
Red Hat Satellite Proxy Server administrators and administrators with updated Satellite settings require a bootstrap tool that can be used independently. Red Hat Network Bootstrap, invoked with the command
/usr/bin/rhn-bootstrap
, serves that purpose and comes installed by default on both Red Hat Satellite Server and Red Hat Satellite Proxy Server.
If used correctly, the script this tool generates can be run from any client system to conduct the following tasks:
- Redirect client applications to the Red Hat Satellite Proxy or Satellite
- Import custom GPG keys
- Install SSL certificates
- Register the system to Red Hat Network and particular system groups and channels with the help of activation keys
- Perform miscellaneous post-configuration activities, including updating packages, performing reboots, and altering Red Hat Network configuration
Warning
There are inherent risks to using a script to conduct configuration. Security tools such as SSL certificates are installed by the script itself; therefore they do not yet exist on the systems and cannot be used to process transactions. This allows for the possibility of someone impersonating the Satellite and transmitting bad data. This is mitigated by the fact that virtually all Satellites and client systems operate behind customer firewalls and are restricted from outside traffic. Registration is conducted via SSL and is therefore protected.
The bootstrap script
bootstrap.sh
is automatically placed in the /var/www/html/pub/bootstrap/
directory of the Red Hat Network Server. From there it can be downloaded and run on all client systems. Note that some preparation and post-generation editing is required, as identified in the following sections. See Section 4.1.1.4, “Configuring Red Hat Network Bootstrap Options” for the tool's complete list of options. Finally, see Section 4.1.1.7, “Sample Bootstrap Script” for an example script.
4.1.1.1. Preparing for Red Hat Network Bootstrap Installation 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Since Red Hat Network Bootstrap (
rhn-bootstrap
) depends on other components of the Red Hat Network infrastructure to properly configure client systems, those components must be prepared before script generation. The following list identifies initial measures:
- Generate activation keys to be called by the script(s). Activation keys can be used to register Red Hat Enterprise Linux systems, entitle them to an Red Hat Network service level, and subscribe them to specific channels and system groups, all in one action. Note that the organizational account must have Management entitlements available to use an activation key, while inclusion of multiple activation keys at once requires Provisioning entitlements. Generate activation keys through the Activation Keys page within the Systems category of the Red Hat Satellite website (either the central Red Hat Network Servers for Proxy or the fully qualified domain name of the Satellite).
- Red Hat recommends RPMs be signed by a custom GNU Privacy Guard (GPG) key. Make the key available so that it can be referred to from the script. Generate the key as described in the Red Hat Satellite Reference Guide and place the key in the
/var/www/html/pub/
directory of the Red Hat Satellite Server. See the Importing Custom GPG Keys section in the Red Hat Satellite Reference Guide. - To deploy the CA SSL public certificate through the script, have the certificate or the package (RPM) containing that certificate available on that Red Hat Network Server and include it during script generation with the
--ssl-cert
option. See the SSL Infrastructure section of the Client Configuration Guide for details. - Have the values ready to develop one or many bootstrap scripts, depending on the variety of systems to be reconfigured. Since Red Hat Network Bootstrap provides a full set of reconfiguration options, use it to generate different bootstrap scripts to accommodate each type of system. For instance,
bootstrap-web-servers.sh
might be used to reconfigure the Web servers, whilebootstrap-app-servers.sh
can handle the application servers. See Section 4.1.1.4, “Configuring Red Hat Network Bootstrap Options” for the complete list.
4.1.1.2. Generating Bootstrap Scripts 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Now that all of the necessary components are in place, use Red Hat Network Bootstrap to generate the required scripts. Log into your Red Hat Satellite Server or Red Hat Satellite Proxy Server as root and issue the
rhn-bootstrap
command followed by the desired options and values. If no options are included, a bootstrap.sh
file is created in the bootstrap/
subdirectory that contains the essential values derived from the server, including hostname, the SSL certificate, it if exists, SSL and GPG settings, and a call for the client-config-overrides.txt
file.
At a minimum, Red Hat strongly recommends the scripts also accommodate activation keys, GPG keys, and advanced configuration options in the following manner:
- Use the
--activation-keys
option to include keys, taking into account the entitlement requirements identified in Section 4.1.1.1, “Preparing for Red Hat Network Bootstrap Installation”. - Use the
--gpg-key
option to identify the key path and filename during script generation. Otherwise, use the--no-gpg
option to turn off this verification on client systems. Red Hat recommends retaining this security measure. - Include the
--allow-config-actions
flag to enable remote configuration management on all client systems touched by the script. This feature is useful in reconfiguring multiple systems simultaneously. - Include the
--allow-remote-commands
flag to enable remote script use on all client systems. Like configuration management, this feature aids in reconfiguring multiple systems.
When done, the command will look something like this:
rhn-bootstrap --activation-keys KEY1,KEY2 \ --gpg-key /var/www/html/pub/MY_CORPORATE_PUBLIC_KEY \ --allow-config-actions \ --allow-remote-commands
# rhn-bootstrap --activation-keys KEY1,KEY2 \
--gpg-key /var/www/html/pub/MY_CORPORATE_PUBLIC_KEY \
--allow-config-actions \
--allow-remote-commands
Remember to include the actual key names. See Section 4.1.1.4, “Configuring Red Hat Network Bootstrap Options” for the complete list of options.
4.1.1.3. Using the Red Hat Network Bootstrap Script 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Once the script has been prepared for use, it is now ready to be run. Log into the Red Hat Satellite Server or Red Hat Satellite Proxy Server, navigate to the
/var/www/html/pub/bootstrap/
directory and run the following command, altering the hostname and name of the script as needed to suit the system type:
cat bootstrap-EDITED-NAME.sh | ssh root@CLIENT_MACHINE1 /bin/bash
# cat bootstrap-EDITED-NAME.sh | ssh root@CLIENT_MACHINE1 /bin/bash
A less secure alternative is to use either
wget
or curl
to retrieve and run the script from every client system. Log into each client machine and issue the following command, altering script and hostname accordingly:
wget -qO - \ https://your-satellite.example.com/pub/bootstrap/bootstrap-EDITED-NAME.sh \ | /bin/bash
# wget -qO - \
https://your-satellite.example.com/pub/bootstrap/bootstrap-EDITED-NAME.sh \
| /bin/bash
Or with
curl
:
curl -Sks \ https://your-satellite.example.com/pub/bootstrap/bootstrap-EDITED-NAME.sh \ | /bin/bash
# curl -Sks \
https://your-satellite.example.com/pub/bootstrap/bootstrap-EDITED-NAME.sh \
| /bin/bash
When this script has been run on each client system, all should be configured to use the Red Hat Network Server.
4.1.1.4. Configuring Red Hat Network Bootstrap Options 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The Red Hat Network Bootstrap offers many command line options for creating client bootstrap scripts. Although descriptions of these options can be found within the following table, ensure that they are available in the version of the tool installed on the Red Hat Network Server by issuing the command
rhn-bootstrap --help
or reviewing its man page.
Option | Description |
---|---|
-h , --help | Display the help screen with a list of options specific to generating the bootstrap script. |
--activation-keys=ACTIVATION_KEYS | Activation key(s) with multiple entries separated by a comma and no space. |
--overrides=OVERRIDES | Configuration overrides filename. The default is client-config-overrides.txt. |
--script=SCRIPT | The bootstrap script filename. The default is bootstrap.sh. |
--hostname=HOSTNAME | The fully qualified domain name (FQDN) of the server to which client systems will connect. |
--ssl-cert=SSL_CERT | The path to the organization's public SSL certificate, either a package or a raw certificate. It will be copied to the --pub-tree option. A value of "" will force a search of --pub-tree . |
--gpg-key=GPG_KEY | The path to the organization's public GPG key, if used. It will be copied to the location specified by the --pub-tree option. |
--http-proxy=HTTP_PROXY | The HTTP proxy setting for the client systems in the form hostname:port . A value of "" disables this setting. |
--http-proxy-username=HTTP_PROXY_USERNAME | If using an authenticating HTTP proxy, specify a username. A value of "" disables this setting. |
--http-proxy-password=HTTP_PROXY_PASSWORD | If using an authenticating HTTP proxy, specify a password. |
--allow-config-actions | Boolean; including this option sets the system to allow all configuration actions via Red Hat Network. This requires installing certain rhncfg-* packages, possibly through an activation key. |
--allow-remote-commands | Boolean; including this option sets the system to allow arbitrary remote commands via Red Hat Network. This requires installing certain rhncfg-* packages, possibly through an activation key. |
--no-ssl | Not recommended - Boolean; including this option turns SSL off on the client system. |
--no-gpg | Not recommended - Boolean; including this option turns GPG checking off on the client system. |
--pub-tree=PUB_TREE | Change not recommended - The public directory tree where the CA SSL certificate and package will land; the bootstrap directory and scripts. The default is /var/www/html/pub/ . |
--force | Not recommended - Boolean; including this option forces bootstrap script generation despite warnings. |
-v , --verbose | Display verbose messaging. Accumulative; -vvv causes extremely verbose messaging. |
4.1.1.5. Manually Scripting the Red Hat Network Bootstrap Configuration 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Note that this section provides an alternative to using Red Hat Network Bootstrap to generate the bootstrap script. Below are instructions that should assist in creating a bootstrap script from scratch.
All of the initial techniques have shared a common theme: the deployment of necessary files in a centralized location to be retrieved and installed using simple, scriptable commands run on each client. In this section, we explore putting all of these pieces together to create a single script that can be invoked by any system in your organization.
By combining all of the commands learned in the previous section and putting them in the most sensible order, we are able to produce the script below:
This script comprises a clean and repeatable process that should fully configure any potential Red Hat Satellite client in preparation for registration to a Red Hat Satellite Proxy Server or Red Hat Satellite. Remember, key values, such as the URL of the Red Hat Satellite Server, its public directory, and the actual GPG key must be inserted into the placeholders listed within the script. Also, depending on the environment, additional modifications may be required. Although this script may work nearly verbatim, it should be used as a guide.
Like its components, this script may be centrally located. By placing this script in the
/pub/
directory of the server, running wget -O-
on it, and piping the output to a shell session, the entire bootstrap process can be run with a single command from each client:
wget -O - http://proxy-or-sat.example.com.com/pub/bootstrap_script | bash
# wget -O - http://proxy-or-sat.example.com.com/pub/bootstrap_script | bash
Warning
Running a shell script directly from input piped in over a Web connection obviously has some inherent security risks. Therefore, it is vital to ensure the security of the source server in this instance.
This one-line command may then be invoked across all of the systems on a network. This script may also be a good addition to the %post section of an existing kickstart script.
4.1.1.6. Implementing Kickstart 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The best time to make configuration changes to a system is when that system is first being built. For customers who already use kickstart effectively, the bootstrapping script is an ideal addition to that process.
Once all of the configuration issues have been resolved, a system may also register with the local Red Hat Network Servers using the
rhnreg_ks
utility that comes with the rhn-setup
RPMs. This section discusses the proper use of rhnreg_ks
to register systems.
The
rhnreg_ks
utility uses activation keys to register, entitle, and subscribe systems to specified channels in one swift motion. To find out more about activation keys, see the Red Hat Update Agent and Red Hat Network Website sections of the Red Hat Network Management Reference Guide.
The following commented kickstart file is an ideal example of how a system can be configured from start to finish using Red Hat Satellite.
4.1.1.7. Sample Bootstrap Script 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The
/var/www/html/pub/bootstrap/bootstrap.sh
script generated by the Red Hat Satellite Server installation program provides the ability to reconfigure client systems to access the Red Hat Satellite Server easily. It is available to both Red Hat Satellite Server and Red Hat Satellite Proxy Server customers through the RHN Bootstrap tool. After modifying the script for a particular use, it can be run on each client machine.
Review the sample and its comments, beginning with a hash mark (#), for additional details. Follow the steps in the Getting Started Guide to prepare the script for use.