3.2. Answers File

In order to configure Red Hat Update Infrastructure, a series of configuration RPMs are required. These are created by RHUI 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.3. Editing the Answers File

  1. Copy /etc/rhui/answers.sample to another location on your local machine:
    $ cp /etc/rhui/answers.sample /etc/rhui/myanswersfile
  2. 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.
  3. General

    The General section contains all the general configuration options for Red Hat Update Infrastructure.
    1. version

      RHUI Installer needs to generate configuration RPMs. These RPMs will be given the version number 2.0 by default. To make the RPMs use a different version number, enter it here:
      [general]
      version: 2.0
      
      This setting will apply to all configuration RPMs created using this answers file. It can be overridden in any of the sub-sections for just that subsection. For example, if version: 2.0 is set in the General section, and version: 2.5 is set in the RHUA section, all the CDS RPMs will be version 2.0, and all the RHUA RPMs will be version 2.5.
    2. dest_dir

      Enter the full path to the location where RHUI 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
      
  4. RHUA

    The RHUA section contains configuration options for the Red Hat Update Appliance (RHUA). There must be only one RHUA section in the answers file.
    1. rpm_name

      Enter a name for the RHUA 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
      
    2. hostname

      Enter the fully qualified domain name of the RHUA 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
      
    3. ssl_cert and ssl_key

      Enter the full paths to the SSL certificate and its private key. These will be used to configure Apache on the RHUA instance:
      ssl_cert: rhua.crt
      ssl_key: rhua.key
      
    4. ca_cert

      Enter the full path to the certificate authority (CA) certificate:
      ca_cert: ca.crt
      
    5. Optional Proxy Parameters

      It is possible to specify optional parameters to be used as a proxy server when the RHUA 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, only proxy_server_host and proxy_server_port need to be defined.

      Important

      When specifying the proxy_server_host parameter, ensure you do not have a trailing slash in the URL, as resolution of the address will fail. For example, use proxy.example.com not proxy.example.com/ to avoid errors.
  5. 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 a cds- prefix, for example:
    [cds-1]
    -- parameters for a CDS --
    
    [cds-2]
    -- parameters for a different CDS --
    
    1. 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
      
    2. hostname

      Enter the fully qualified domain name 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: cds1.example.com
      
    3. ssl_cert and ssl_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: cds1.crt
      ssl_key: cds1.key
      
  6. To execute the file and create the configuration RPMs, 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 RHUA and the CDS instances, using the names you gave for each.
  7. Copy the RHUA configuration RPM to the RHUA and install it:
    $ rpm -Uvh /tmp/rhui/rh-rhua-config-2.0-2.el6.noarch.rpm
  8. Copy the CDS configuration RPM for each CDS instance (as defined by the hostname in the [cds-1] section) and install it:
    $ rpm -Uvh /tmp/rhui/rh-cds1-config-2.0-2.el6.noarch.rpm

Example 3.1. Example Answers File

This example shows the example answers file. This 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.0

# 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: cds1.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: cds2.example.com
# ssl_cert:
# ssl_key: