Chapter 11. Sample Scenarios

11.1. Simple Scenario

The simple scenario shows how to add a single host, register it, set up, and run a job on it.

11.1.1. Creating the Host

The following procedure provides an example on how to create a host in Red Hat Satellite.

To Create a Host:

  1. Click Hosts > Create Host.
  2. On the Host tab, enter the required details:

    1. In the Name field, enter the host name, for example host1.example.com.
    2. In the Organization field, enter the organization name, for example MyOrg.
    3. In the Location field, enter the location name, for example MyLoc.
  3. Optionally, on the Puppet Classes tab, select the Puppet classes you want to include.
  4. On the Interfaces tab, edit the primary interface:

    1. Click the Edit button in the Actions column.
    2. Select a type from the Type list, for example Interface.
    3. In the MAC address field, enter the MAC address of your host.
    4. In the Device Identifier field, specify the device identifier for this interface, for example eth0.
    5. In the DNS name field, specify the DNS name of your host. For the primary interface, this host name is used with the domain name to form the FQDN.
    6. Select a domain from the Domain list, for example satellite.example.com. This automatically updates the IPv4 Subnet and IPv6 Subnet lists with a selection of available subnets. Optionally, select the subnets.
    7. In the IPv4 address field, specify the IPv4 address of your host.
    8. Click Ok.
  5. On the Operating System tab, enter the required details:

    1. Select an architecture from the Architecture list, for example x86_64.
    2. Select an operating system from the Operating system list, for example RHEL Server 7.4.
    3. Select a partition table from the Partition table list, for example Kickstart default.
    4. In the Root password field, enter the root password for your host.
  6. Optionally, on the Parameters tab, select the parameters you want to supply to the Puppet master to override the default values.
  7. Optionally, on the Additional Information tab, enter additional information about the host.
  8. Click Submit.

11.1.2. Registering the Host

After you have created host1.example.com, you must register it so that it can receive updates. The following procedure assumes the host is running Red Hat Enterprise Linux 7.

To Register the Host:

  1. In a terminal, connect to the host as the root user.
  2. Ensure that a time synchronization tool is enabled and running on the host:

    # systemctl start chronyd; systemctl enable chronyd
  3. Install the consumer RPM from the Satellite Server or Capsule Server to which the host is to be registered. The consumer RPM updates the content source location of the host and allows the host to download content from the content source specified in Red Hat Satellite.

    # rpm -Uvh http://satellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm
  4. Ensure that an activation key associated with the appropriate Content View and environment exists for the host. If not, see Managing Activation Keys in the Content Management Guide for more information.
  5. Clear any old host data related to Red Hat Subscription Manager (RHSM):

    # subscription-manager clean
  6. Register the host using RHSM:

    # subscription-manager register --org=MyOrg \
    --activationkey=my_activation_key

    Command output after registration:

    # subscription-manager register --org=MyOrg --activationkey=my_activation_key
    The system has been registered with id: 62edc0f8-855b-4184-b1b8-72a9dc793b96
  7. Enable the Red Hat Satellite Tools 6 repository:

    # subscription-manager repos --enable=rhel-version-server-satellite-tools-6-rpms
  8. Install the katello-agent:

    # yum install katello-agent
  9. Ensure the goferd service is running:

    # systemctl start goferd
  10. Install and configure the Puppet agent:

    1. Install the Puppet agent:

      # yum install puppet
    2. Configure the Puppet agent to start at boot:

      # systemctl enable puppet
  11. Append the following server and environment settings to the /etc/puppetlabs/puppet/puppet.conf file. Set the environment parameter to the name of the Puppet environment to which the host belongs:

    environment = My_Example_Org_Library
    server = satellite.example.com
    ca_server = satellite.example.com
  12. Run the Puppet agent on the host:

    # puppet agent -t
  13. Sign the SSL certificate for the Puppet client in the Satellite Server web UI:

    1. Log in to the Satellite Server web UI.
    2. Select Infrastructure > Capsules.
    3. Select Certificates from the list to the right of the required Capsule.
    4. Click Sign to the right of the required host.
    5. Enter the puppet agent command again:

      # puppet agent -t

11.1.3. Running a Job on the Host

The following procedure shows how to run a job template on the previously created and registered host host1.example.com.

To Execute a Remote Job:

  1. Navigate to Hosts > All hosts and select the target host, in our example host1.example.com.
  2. From the Select Action list at the upper right of the screen select Schedule Remote Job.
  3. On the Job invocation page, define the main job settings:

    1. Select a job category from the Job category list, for example Commands.
    2. Select a job template from the Job template list, for example Run Command - SSH Default.
    3. In the command field, enter the command you want to run on the host. For example, timedatectl set-timezone Europe/Prague will set the time zone to Prague in Europe.
  4. Click Submit.