Chapter 4. Red Hat Network Website
81
addresses this by allowing the inclusion of macros, or variables, within the configuration files it man-
ages for Provisioning-entitled systems. In addition to variables for custom system information, the
following standard macros are supported:
•
rhn.system.sid
•
rhn.system.profile_name
•
rhn.system.description
•
rhn.system.hostname
•
rhn.system.ip_address
•
rhn.system.custom_info(key_name)
•
rhn.system.net_interface.ip_address(eth_device)
•
rhn.system.net_interface.netmask(eth_device)
•
rhn.system.net_interface.broadcast(eth_device)
•
rhn.system.net_interface.hardware_address(eth_device)
•
rhn.system.net_interface.driver_module(eth_device)
To use this powerful feature, either upload or create a configuration file through the
Configuration
Channel Details
page. Then, open its
Configuration File Details
page and include the supported
macros of your choosing. Ensure the delimiters used to offset your variables match those set in the
Macro Start Delimiter
and
Macro End Delimiter
fields and do not conflict with other characters in
the file. The delimiters must be two characters and cannot contain the percent (%) symbol.
As an example, you may have a file applicable to all of your servers that differs only in IP address and
hostname. Rather than manage a separate configuration file for each server, you may create a single
file, say
server.conf
, with the IP address and hostname macros included, like so:
hostname={@ rhn.system.hostname @}
ip_address={@ rhn.system.net_interface.ip_address(eth0) @}
Upon delivery of the file to individual systems, whether through a scheduled action in the RHN web-
site or at the command line with the
Red Hat Network Configuration Client
(
rhncfg-client
),
the variables will be substituted with the actual hostname and IP address of the system, as recorded in
RHN’s System Profile, such as:
hostname=test.example.domain.com
ip_address=177.18.54.7
To capture custom system information, insert the key label into the custom information macro
(rhn.system.custom_info). For instance, if you developed a key labeled "cubicle" you can add it to
the custom information macro in a configuration file to have the value substituted on any system
containing it. The macro would look like this:
cubicle={@ rhn.system.custom_info(cubicle) @}
Upon deployment of the file to a system containing a value for that key, the macro gets translated,
such as:
cubicle=Cube #456
To include a default value, for instance if one is required to prevent errors, you can append it to the
custom information macro, like so:
cubicle={@ rhn.system.custom_info(cubicle) = ’Cube #’ @}
Содержание NETWORK 3.5 - PROVISIONING
Страница 1: ...Red Hat Network 3 5 Provisioning Reference Guide...
Страница 6: ......
Страница 16: ...6 Chapter 1 What is Red Hat Network...
Страница 50: ...40 Chapter 3 Red Hat Network Alert Notification Tool...
Страница 98: ...88 Chapter 4 Red Hat Network Website...
Страница 114: ...104 Chapter 6 Red Hat Network Registration Client...
Страница 122: ...112 Appendix A Command Line Config Management Tools...
Страница 126: ...116 Appendix B RHN API Access...
Страница 132: ...122 Glossary...