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:
- Click Hosts > Create Host.
On the Host tab, enter the required details:
- In the Name field, enter the host name, for example host1.example.com.
- In the Organization field, enter the organization name, for example MyOrg.
- In the Location field, enter the location name, for example MyLoc.
- Optionally, on the Puppet Classes tab, select the Puppet classes you want to include.
On the Interfaces tab, edit the primary interface:
- Click the Edit button in the Actions column.
- Select a type from the Type list, for example Interface.
- In the MAC address field, enter the MAC address of your host.
- In the Device Identifier field, specify the device identifier for this interface, for example eth0.
- 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.
- 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.
- In the IPv4 address field, specify the IPv4 address of your host.
- Click Ok.
On the Operating System tab, enter the required details:
- Select an architecture from the Architecture list, for example x86_64.
- Select an operating system from the Operating system list, for example RHEL Server 7.4.
- Select a partition table from the Partition table list, for example Kickstart default.
- In the Root password field, enter the root password for your host.
- Optionally, on the Parameters tab, select the parameters you want to supply to the Puppet master to override the default values.
- Optionally, on the Additional Information tab, enter additional information about the host.
- 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:
- In a terminal, connect to the host as the root user.
Ensure that a time synchronization tool is enabled and running on the host:
# systemctl start chronyd; systemctl enable chronyd
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
- 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.
Clear any old host data related to Red Hat Subscription Manager (RHSM):
# subscription-manager clean
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
Enable the Red Hat Satellite Tools 6 repository:
# subscription-manager repos --enable=rhel-version-server-satellite-tools-6-rpms
Install the katello-agent:
# yum install katello-agent
Ensure the goferd service is running:
# systemctl start goferd
Install and configure the Puppet agent:
Install the Puppet agent:
# yum install puppet
Configure the Puppet agent to start at boot:
# systemctl enable puppet
Append the following server and environment settings to the
/etc/puppetlabs/puppet/puppet.conffile. Set the
environmentparameter 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
Run the Puppet agent on the host:
# puppet agent -t
Sign the SSL certificate for the Puppet client in the Satellite Server web UI:
- Log in to the Satellite Server web UI.
- Select Infrastructure > Capsules.
- Select Certificates from the list to the right of the required Capsule.
- Click Sign to the right of the required host.
puppet agentcommand 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:
- Navigate to Hosts > All hosts and select the target host, in our example host1.example.com.
- From the Select Action list at the upper right of the screen select Schedule Remote Job.
On the Job invocation page, define the main job settings:
- Select a job category from the Job category list, for example Commands.
- Select a job template from the Job template list, for example Run Command - SSH Default.
- 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.
- Click Submit.