How to install Foreman 2.x on Ubuntu 20.04

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 for managing the life cycle of servers-provisioning and configuration of orchestration and monitoring. With automated tools that can be used as plug-ins, such as Ansible, Chef, Salt and Puppet, automating repetitive tasks has become so easy. This is done through faster deployment of applications and ensures proactive change management in the VM, bare metal or cloud.

This article will help you install Foreman 2.x on Ubuntu 20.04 (Focal Fossa). The following is the system architecture of Foreman.

Some of the main features unlocked for you include:

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

Install Foreman 2.x on Ubuntu 20.04 (Focal Fossa)

The following are the steps to install Foreman 2.x on Ubuntu 20.04 (Focal Fossa).

Step 1: Set the system host name

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

sudo hostnamectl set-hostname foreman.example.com
echo "192.168.100.21 foreman.example.com" | sudo tee -a /etc/hosts

Replace the host name and IP address with your actual values.

Make sure that the following command displays 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 127.0.0.1, please change or delete the entry (if it exists) from the / etc / hosts file.

Step 2: Update the system

After the host name is correctly configured, update the system to obtain the latest software package.

sudo apt update && sudo apt upgrade
sudo systemctl reboot

Step 3: Add a puppet and foreman repository

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

Add the Puppet repository to Ubuntu 20.04:

sudo apt update
sudo apt -y install ca-certificates wget
wget https://apt.puppet.com/puppet6-release-focal.deb
sudo apt install ./puppet6-release-focal.deb

Add the Foreman repository to the system.

sudo apt -y install gpg ca-certificates
echo "deb http://deb.theforeman.org/ bionic 2.0" | sudo tee /etc/apt/sources.list.d/foreman.list
echo "deb http://deb.theforeman.org/ plugins 2.0" | sudo tee -a /etc/apt/sources.list.d/foreman.list
wget -q https://deb.theforeman.org/pubkey.gpg -O- | sudo apt-key add -

Step 4: Install the Foreman installer

After adding the repository, you should be ready to install Foreman on Ubuntu 20.04 (Focal Fossa).

sudo apt update
sudo apt install foreman-installer

hit ÿ Accept the installed key.

The following additional packages will be installed:
  libgdbm-compat4 libruby2.5 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-did-you-mean ruby-hashie ruby-highline ruby-kafo ruby-kafo-parsers
  ruby-kafo-wizards ruby-little-plugger ruby-logging ruby-minitest ruby-multi-json ruby-net-telnet ruby-power-assert ruby-powerbar ruby-test-unit
  ruby2.5 rubygems-integration
Suggested packages:
  ri ruby-dev bundler
Recommended packages:
  zip ruby-oj fonts-lato libjs-jquery
The following NEW packages will be installed:
  foreman-installer libgdbm-compat4 libruby2.5 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-did-you-mean ruby-hashie ruby-highline ruby-kafo
  ruby-kafo-parsers ruby-kafo-wizards ruby-little-plugger ruby-logging ruby-minitest ruby-multi-json ruby-net-telnet ruby-power-assert ruby-powerbar
  ruby-test-unit ruby2.5 rubygems-integration
0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.4 MB of archives.
After this operation, 162 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Step 5: Run the foreman installer on Ubuntu 20.04

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

By default, it will configure:

  • Apache HTTP with SSL (use puppet-signed certificate)
  • Foreman runs under mod_passenger
  • Smart proxy configured for Puppet, TFTP and SSL
  • Puppet master running under mod_passenger
  • Puppet agent is configured
  • TFTP server (under xinetd on the Red Hat platform)

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

$ foreman-installer --help

To run the foreman installation in interactive mode, use:

sudo foreman-installer -i

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

sudo foreman-installer

If Smart Proxy, Puppet master is installed on Foreman, the installer will output detailed information about them after installation.

Preparing installation Done                                              
  Success!
  * Foreman is running at https://foreman.example.com
      Initial credentials are admin / yafNTaFNNJRUGP84
  * Foreman Proxy is running at https://foreman.example.com:8443
  The full log is at /var/log/foreman-installer/foreman.log

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

How to install Foreman 2.x on Ubuntu 20.04

The appearance of the foreman management dashboard is as follows:

How to install Foreman 2.x on Ubuntu 20.04

Read more about how to manage foreman and benefit from its excellent features

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