3.2. Editing the Answers File
In order to configure Red Hat Update Infrastructure, a series of configuration RPMs are required. These are created by Red Hat Update Infrastructure Installer using an answers file. Red Hat Update Infrastructure includes an example answers file at
/etc/rhui/answers.sample
to use as a basis for creating your own answers file. There is also an example answers file at Example 3.1, “Example Answers File”.
Procedure 3.4. Editing the Answers File
- Copy
/etc/rhui/answers.sample
to another location on your local machine:# cp /etc/rhui/answers.sample /etc/rhui/myanswersfile
- Open the local copy of the file in your preferred text editor. The answers file is divided into three sections: General, RHUA, and CDS Instances.
General
The General section contains all the general configuration options for Red Hat Update Infrastructure.version
Red Hat Update Infrastructure Installer needs to generate configuration RPMs. These RPMs will be given the version number2.1
by default. To make the RPMs use a different version number, enter it here:[general] version: 2.1
By default, this setting will apply to all the configuration RPMs that were created using this answers file. However, it can be overridden for specific sub-sections. For example, if in the General section version is set toversion: 2.1
, all the CDS RPMs will be version 2.1. Similarly, if you set Red Hat Update Appliance section version toversion: 2.5
, all the Red Hat Update Appliance RPMs will be version 2.5.dest_dir
Enter the full path to the location where Red Hat Update Infrastructure Installer should create the configuration RPMs. Every RPM will be located in this directory after it runs and temporary files will be located in a sub-directory.dest_dir: /tmp/rhui
Red Hat Update Appliance
The Red Hat Update Appliance section contains configuration options for the Red Hat Update Appliance (RHUA). There must be only one Red Hat Update Appliance section on the answers file.rpm_name
Enter a name for the Red Hat Update Appliance configuration RPM. This name will have the version and architecture information added to it during the creation process, so there is no need to specify them here:rpm_name: rh-rhua-config
hostname
Enter the fully qualified domain name (FQDN) of the Red Hat Update Appliance instance. This must not be an IP address, but a resolvable DNS name. Ensure that your SSL certificate has been created for this DNS name, as they must match exactly:hostname: rhua.example.com
ssl_cert
andssl_key
Enter the full paths to the SSL certificate and its private key. These will be used to configure Apache on the Red Hat Update Appliance instance:ssl_cert: /path/to/ssl_RHUA.crt ssl_key: /path/to/ssl_RHUA.key
ca_cert
Enter the full path to the certificate authority (CA) certificate:ca_cert: /path/to/ca.crt
Optional Proxy Parameters
It is possible to specify optional parameters to be used as a proxy server when the Red Hat Update Appliance attempts to access the internet (external to the cloud) and download packages from Red Hat.proxy_server_host: proxy.example.com proxy_server_port: 443 proxy_server_username: admin proxy_server_password: password
For non-authenticating proxy servers, onlyproxy_server_host
andproxy_server_port
need to be defined.Important
When specifying theproxy_server_host
parameter, ensure you do not have a trailing slash in the URL, as resolution of the address will fail. For example, useproxy.example.com
notproxy.example.com/
to avoid errors.
CDS Instances
The CDS section contains configuration options for each CDS instance. Create a new section under the CDS Instances heading for each CDS instance, giving each one a unique title with acds-
prefix, for example:[cds-1] -- parameters for a CDS -- [cds-2] -- parameters for a different CDS --
rpm_name
Enter a name for the CDS configuration RPM. This name will have the version and architecture information added to it during the creation process, so there is no need to specify them here:rpm_name: rh-cds1-config
hostname
Enter the fully qualified domain name (FQDN) of the CDS instance. This must not be an IP address, but a resolvable DNS name. Ensure that your SSL certificate has been created for this DNS name as they must match exactly:hostname: cds01.example.com
ssl_cert
andssl_key
Enter the full paths to the SSL certificate and its private key. These will be used to configure Apache on the CDS instance:ssl_cert: /path/to/ssl_cds01.crt ssl_key: /path/to/ssl_cds01.key
Note
To create a new CDS after Red Hat Update Infrastructure is deployed, refer to Section 3.3, “Adding a Content Delivery Server”.- To execute the file and create the configuration RPMs, change to root user and run the
rhui-installer
command:# rhui-installer /etc/rhui/myanswersfile
The configuration RPMs will be saved to the location you specified in Step 3.b. There will be a configuration RPM for both the Red Hat Update Appliance and the CDS instances, using the names you gave for each. - Copy the Red Hat Update Appliance configuration RPM to the Red Hat Update Appliance and install it:
# yum install /tmp/rhui/rh-rhua-config-2.1-2.el6.noarch.rpm
- Copy the CDS configuration RPM for each CDS instance (as defined by the hostname in the
[cds-1]
section) and install it:# yum install /tmp/rhui/rh-cds1-config-2.1-2.el6.noarch.rpm
Example 3.1. Example Answers File
This example answers file is used to generate configuration RPMs.
# # RHUI Installer Sample Answers File # # This sample answers file can be found at /etc/rhui/answers.sample. # # This file is meant to be used as a template for creating an answers file for use with # the RHUI Installer. Once the appropriate values have been entered, the RHUI Installer # will generate RPMs based on these values through the following call: # # $ rhui-installer --answers <path to populated answers file> # # The results of running the above call will be found in the directory specified in the # dest_dir attribute under the [general] section. # == General =============================================== # The [general] section contains configuration options that apply to the RHUI installation # as a whole. [general] # This will be used as the version for all RPMs that are created by this answers file. # Individual components may override this value with the "rpm_version" attribute. version: 2.1 # Local directory into which RHUI tools will place any temporary files as well as the # built RPMs. If this directory exists prior to running RHUI tools, the user executing # it must have write permissions. dest_dir: /tmp/rhui # == RHUA =============================================== # The [rhua] section contains attributes describing a particular RHUA instance. [rhua] # Name of the RHUA configuration RPM created by RHUI tools. rpm_name: rh-rhua-config # Fully qualified hostname of the RHUA instance. hostname: rhua.example.com # SSL certificate and private key to be installed on the RHUA. The CN of this certificate # must match the hostname listed above. ssl_cert: ssl_key: # CA certificate used to sign the RHUA's SSL certificate. This is needed by the CDS # instances when connecting back to the RHUA to synchronize content to verify the # RHUA certificate during the handshake. ca_cert: # If a proxy server is needed for the RHUA to connect to the internet, this is the hostname # of that server. If this is not specified, no proxy server will be used. # proxy_server_host: proxy.example.com # Port to access on the proxy server. This value has no effect if proxy_server_host is # not specified. # proxy_server_port: 443 # Proxy server username. Omit if the proxy server does not require authentication. # proxy_server_username: admin # Proxy server password. # proxy_server_password: password # == CDS Instances =============================================== # There should be one [cds-*] section for each CDS to be used in the RHUI infrastructure. # The name between the [ ] must begin with "cds", however the remainder is arbitrary and must # only be unique with respect to other cds sections. There will be one CDS configuration RPM # generated for each section found. [cds-1] # Name of the RPM that will be created for this CDS configuration. rpm_name: rh-cds1-config # Fully qualified name of this CDS instance. hostname: cds01.example.com # SSL certificate and private key to be used by this CDS instance. The CN of this # certificate must match the hostname listed above. ssl_cert: ssl_key: # [cds-2] # rpm_name: rh-cds2-config # hostname: cds02.example.com # ssl_cert: # ssl_key: