How to install Foreman on CentOS 8 / RHEL 8

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Foreman is a free and open source tool used to automate the provision and configuration of Linux systems. Foreman can be integrated with configuration management tools (such as Ansible, Chef, Salt and Puppet) to provide complete infrastructure lifecycle management in the form of plug-ins. Foreman supports various virtualization and cloud environments. In this blog post, I will explain the steps used to install Foreman on CentOS 8. RHEL 8 Linux system.

Foreman system architecture is shown in the figure below.

Install Foreman on CentOS 8 | RHEL 8

The standard functions of the foreman are:

  • Discover, configure and upgrade your entire bare metal infrastructure
  • Create and manage instances in virtualized environments and private and public clouds
  • Install the operating system via PXE, local media or from a template or image
  • Control and collect reports from your configuration management software
  • Group hosts and manage them in bulk regardless of location
  • View historical changes for review or troubleshooting
  • Web user interface, JSON REST API and CLI for Linux
  • Expand on-demand through a powerful plug-in architecture

Please follow the steps below to install and configure Foreman on CentOS 8. RHEL 8 server.

Step 1: Configure the host name

You need to configure the correct host name for your computer, which can be resolved to an IP address.

sudo hostnamectl set-hostname foreman.example.com

Set the IP address and DNS name in the /etc/hosts file.

$ sudo vi /etc/hosts
192.168.100.21 foreman.example.com

Make sure that the following command shows the real IP address, not 127.0.1.1.

$ ping -c 2 $(hostname -f)
PING foreman.example.com (192.168.100.21) 56(84) bytes of data.
64 bytes from foreman.example.com (192.168.100.21): icmp_seq=1 ttl=64 time=0.052 ms
64 bytes from foreman.example.com (192.168.100.21): icmp_seq=2 ttl=64 time=0.035 ms

--- foreman.example.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1023ms
rtt min/avg/max/mdev = 0.035/0.043/0.052/0.010 ms

If it returns to 127.0.0.1, please change or delete this entry (if it exists) from the /etc/hosts file.

Step 2: Install and configure NTP time synchronization

Install the chrony package.

sudo dnf -y install chrony

Set the correct time zone.

sudo timedatectl set-timezone Africa/Nairobi

Start and enable the chronyd service.

sudo systemctl enable --now chronyd

synchronised time.

$ sudo chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- static.102.162.46.78.cli>     2   7   377    14  -3496us[-3496us] +/-   52ms
^- node2.eriomem.net             2   7   377   145  -5807us[-5831us] +/-   45ms
^* time.cloudflare.com           3   7   377    16    -27us[  -52us] +/-   15ms
^- ntp1.squareflow.net           2   7   377    15  -8346us[-8346us] +/-   61ms

Confirm the current time setting.

$ timedatectl
               Local time: Mon 2020-07-20 01:48:53 EAT
           Universal time: Sun 2020-07-19 22:48:53 UTC
                 RTC time: Sun 2020-07-19 22:48:53
                Time zone: Africa/Nairobi (EAT, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Step 3: Add the puppet and foreman repository

Add dependencies and Puppet and Foreman repositories required for the actual Foreman package installation.

sudo dnf -y install https://yum.puppet.com/puppet6-release-el-8.noarch.rpm

Add the foreman repository:

sudo dnf -y install https://yum.theforeman.org/releases/2.1/el8/x86_64/foreman-release.rpm

Step 4: Install Foreman installer

After adding the two repositories, install the foreman installer in CentOS 8. RHEL 8 system.

sudo dnf -y install foreman-installer

Step 5: Run the foreman installer on CentOS 8 | RHEL 8

After the foreman installer is installed, you need to run it to configure and prepare the foreman components. The Foreman installer is a collection of Puppet modules that can install everything needed for a complete Foreman setup on CentOS 8. RHEL 8.

By default, it will configure:

  • Apache HTTP with SSL (using a certificate signed by Puppet)
  • Foreman runs under mod_passenger
  • Smart proxy configured for Puppet, TFTP and SSL
  • Puppet master running under mod_passenger
  • Puppet agent configured
  • TFTP server (under xinetd on Red Hat platform)

Please note that the installation foreman runs Non-interactive The mode is by default, but the configuration can be customized by providing any of the options listed below:

$ foreman-installer --help

To run the foreman installation interactively, use:

sudo foreman-installer -i

To run the installation in non-interactive mode, use:

sudo foreman-installer

If Smart Proxy and Puppet master are installed with Foreman, the installer will output detailed information about them after installation.

Preparing installation Done
Executing: foreman-rake upgrade:run
foreman-rake upgrade:run finished successfully!
  Success!
  * Foreman is running at https://foreman.example.com
      Initial credentials are admin / QAefJcYDnxQy2yEL
  * Foreman Proxy is running at https://foreman.example.com:8443
  The full log is at /var/log/foreman-installer/foreman.log

If you have an active firewall service, please open all required ports.

sudo firewall-cmd --add-port={22,53,80,443,3000,8140,3306,5432,8443,5910-5930}/tcp --permanent
sudo firewall-cmd --add-port=67-69/udp --permanent
sudo firewall-cmd --reload

Log in to Foreman Dashboard using the details given in the output.

How to install Foreman on CentOS 8 / RHEL 8

Reference official Foreman and Katello documentation Get more useful information about management.

Linux learning courses:


Linux Proficiency: Master the Linux command line in 11.5 hours

Linux Proficiency: Master the Linux command line in 11.5 hours

★★★★★
(8876)

$ 17.17

$ 223.22

In stock

Buy now

How to install Foreman on CentOS 8 / RHEL 8Udemy.com


Complete Linux training courses to help you realize your dream IT job in 2020

Complete Linux training courses to help you realize your dream IT job in 2020

★★★★★
(6577)

$14.88

$228.95

In stock

Buy now

How to install Foreman on CentOS 8 / RHEL 8Udemy.com


Linux Administration Bootcamp: from entry to advanced

Linux Administration Bootcamp: from entry to advanced

★★★★☆
(13298)

$ 13.74

$ 154.54

In stock

Buy now

How to install Foreman on CentOS 8 / RHEL 8Udemy.com

Some key areas for new installations are:

Fore Debian Checkout Our Guide: Install Foreman on Debian 10 Linux

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sidebar