Lab 3.1: Prepare Installation: Objective
Lab 3.1: Prepare Installation: Objective
1: Prepare Installation
Objective:
Steps:
Notes:
The host firewall allows traffic between virtual machines in the same network and forwards traffic from the
virtual machine network to the host so no configuration is required.
Expected result:
The Foreman installer is installed and "foreman-installer --help" could be run from command line.
1 © NETWAYS
Lab 3.2: Install an All-in-one setup
Objective:
In this lab we will install an All-in-one setup of Foreman with DNS and DHCP
Steps:
Notes:
interface=eth0
zone=localdomain
reverse=0.10.in-addr.arpa
forwarders=8.8.8.8,8.8.4.4
DHCP should be enabled and configured with the following parameters:
interface=eth0
gateway=10.0.0.1
range=10.0.0.100-10.0.0.200
nameserver=10.0.0.2
Expected result:
The Foreman installer runs successfully and provides login credentials to login to
'https://foreman.localdomain'.
You can find your provided parameters in the answer file created in '/etc/foreman/foreman-installer-
answers.yaml'.
2 © NETWAYS
Lab 3.3: Add DNS configuration to Foreman
Objective:
Steps:
Login to Foreman
Notes:
If the Puppet agent on the Foreman server has already run the domain will already be created but not
associated.
3 © NETWAYS
Lab 3.4: Add DHCP configuration to Foreman
Objective:
Steps:
Notes:
We will use the complete DHCP range the DHCP server provides.
4 © NETWAYS
Lab 4.1: Prepare PXE installation of CentOS
Objective:
Steps:
Associate the operating system with the Partition table "Kickstart default", Installation media "CentOS
mirror", select the Templates and set parameter "enable-puppetlabs-puppet5-repo" to "true"
5 © NETWAYS
Lab 4.2: Prepare PXE installation of Debian
Objective:
Steps:
Create the Operating system "Debian" with Major version "9", Description "Debian stretch", Family
"Debian", Release name "stretch"
Associate the operating system with the Templates and set Architecture "x86_64", Partition table
"Preseed custom LVM" and "Preseed default", Installation media "Debian mirror" and set parameter
"enable-puppetlabs-puppet5-repo" to "true"
6 © NETWAYS
Lab 4.3: Create a virtual machine "pxe"
Objective:
Steps:
Select "New virtual machine" from the menu or by pressing the button
Select "Linux" and "Red Hat Enterprise Linux 7.5" for CentOS or "Debian Stretch" for Debian according
to your preferences
Create the VM and immediately pause it so in the next lab the required configuration in Foreman can
be created
7 © NETWAYS
Lab 4.4: Configure the system "pxe" in Foreman
Objective:
Steps:
On the Host tab name it "pxe" and select the Environment "production", Puppet CA
"foreman.localdomain" and Puppet Master "foreman.localdomain"
On the Operating system tab select the Architecture "x86_64", Operating System, Media, Partition table
depending on your choice earlier and set a Root password of your choice
On the Interface tab click edit to configure the interface with the MAC address of the system created
before, identifier "eth0", select Domain "localdomain" and Subnet "foreman" and keep the suggested IP
address
8 © NETWAYS
Lab 4.5: Prepare Compute resource libvirt
Objective:
Steps:
Copy the public key to the root account of the host "host.localdomain" using ssh-copy-id
9 © NETWAYS
Lab 4.6: Create the virtual machine "compute" from Foreman
Objective:
Create the virtual machine "compute" from Foreman Web GUI and start unattended installation
Steps:
On the Host tab name it "compute" and select to deploy on the Compute resource, the Environment,
Puppet CA and Master
On the Operating system tab select the Architecture, Operating System, Media, Partition table and set
a Root password.
On the Interface tab click edit to configure the interface with identifier "eth0", select Domain and
Subnet and keep the suggested IP address, for the Libvirt options choose the virtual network
"foreman"
10 © NETWAYS
Lab 4.7: Install and configure the Discovery plugin
Objective:
Steps:
Run the Foreman installer to install the Discovery plugin for Foreman and the Smart Proxy and
download the image
11 © NETWAYS
Lab 4.8: Create a virtual machine "discovery"
Objective:
Steps:
Select "New virtual machine" from the menu or by pressing the button
Select "Linux" and "Red Hat Enterprise Linux 7.5" for CentOS or "Debian Stretch" for Debian according
to your preferences
Name your virtual machine "discovery" and select the network "foreman"
Create the virtual machine and when the PXE menu appears select "Foreman Discovery Image"
Expected result:
The Discovery images boots, reports status "SUCCESS" on the console and appears in the Foreman Web
GUI in the "Discovery widget".
12 © NETWAYS
Lab 4.9: Configure the system "discovery" in Foreman
Objective:
Steps:
On the Discovered host view select the action "Provision" and then "Customize Host"
On the Host tab name it "discovery" and select the Environment, Puppet CA and Master
On the Operating system tab select the Architecture, Operating System, Media, Partition table and set
a Root password
On the Interface tab click edit to configure the interface add the Domain "localdomain"
13 © NETWAYS
Lab 4.10: Install and configure the Bootdisk plugin
Objective:
Steps:
14 © NETWAYS
Lab 4.11: Reinstall the virtual machine "pxe"
Objective:
Steps:
Set the Host "pxe" in "Build" mode and download the host image
Configure virtual machine to boot from image by adding a "CDROM" device and selecting it as boot
media
15 © NETWAYS
Lab 5.1: Import of Puppet classes
Objective:
Steps:
Optional:
Expected result:
Class "training::user" is available in the WebGUI and can be assigned to hosts and hostgroups
16 © NETWAYS
Lab 5.2: Parameterize and assign Puppet classes
Objective:
Steps:
Set defaults to the Smart class parameters provided by the imported class
17 © NETWAYS
Lab 5.3: Trigger Puppet agent run and inspect the report
Objective:
Steps:
Run the Puppet agent in test mode on the host you assigned the class
18 © NETWAYS
Lab 5.4: Configure Ansible Callback
Objective:
Steps:
Expected result:
19 © NETWAYS
Lab 5.5: Configure Ansible Dynamic Inventory
Objective:
Steps:
Adjust configuration
Configuration has to include Foreman url, user and password.
Test Dynamic Inventory
You can run the script directly to the output and use it with the parameter -i during playbook runs.
20 © NETWAYS
Lab 5.6: Configure Graphical Integration
Objective:
Steps:
21 © NETWAYS
Lab 6.1: LDAP Authentication
Objective:
Allow the administrative accounts from the LDAP to work as Foreman admins
Steps:
Add a administrative group to grant the administrative accounts from the LDAP privileges
Expected result:
Login with the account "administrator" of the group "admins" with password "netways" to grant
administrative privileges
Server: foreman.localdomain
Protocol: LDAP (Port 389/tcp)
Schema: POSIX
Base DN: dc=localdomain
User DN: ou=users,dc=localdomain
Group DN: ou=groups,dc=localdomain
22 © NETWAYS
Lab 6.2: Add unprivileged users
Objective:
Steps:
Create a role "Selfservice" to allow creation of new hosts and management of own hosts
Expected result:
Login with the account "viewer" and password "netways" grants read-only privileges
Login with the account "selfservice" and password "netways" allows to created new hosts
23 © NETWAYS
Lab 7.1: Templates
Objective:
Steps:
Optional:
Expected result:
24 © NETWAYS
Lab 7.2: DHCP Browser
Objective:
Steps:
Expected result:
You will find one reservation for every host created earlier.
25 © NETWAYS
Lab 7.3: Column View
Objective:
Steps:
Install the Foreman Plugin Column View using the package "tfm-rubygem-foreman_column_view"
Configure it to show the facts for architecture and uptime and restart the service
Expected result:
Additional columns are showing the values of the facts for architecture and uptime on all hosts which
reported a Puppet run.
26 © NETWAYS
Lab 7.4: OpenSCAP
Objective:
Steps:
Install the Foreman and Smart Proxy Plugin OpenSCAP using the foreman-installer
Optional:
Customize the Policy with a tailor file created with SCAP workbench
Expected result:
27 © NETWAYS
Lab 7.5: Cockpit
Objective:
Steps:
Expected result:
Cockpit action menu shows up in the Host detail view and allows to inspect the system.
28 © NETWAYS
Lab 7.6: Remote Execution
Objective:
Steps:
Install the Foreman Plugin Remote Execution using the Foreman Installer
Optional:
Expected result:
29 © NETWAYS
Lab 7.7: Remote Execution - Job Template
Objective:
Create a Job Template "ping" to run the ping command on remote hosts
Steps:
Create a Job Template to run ping with default values for count and target and input field for target
30 © NETWAYS
Lab 7.8: Expire Hosts
Objective:
Steps:
Install the Foreman Plugin Expire Hosts using the Foreman Installer
Expected result:
31 © NETWAYS
Lab 7.9: Monitoring Integration
Objective:
Steps:
32 © NETWAYS
Lab 8.1: Working with the API
Objective:
Steps:
Query the API for all subnets using the URL endpoint "/api/subnets"
Query the API for all Debian hosts using the URL endpoint "/api/hosts" and the search "os=Debian" or
"facts.osfamily=Debian"
Change the root password for the hostgroup "training" using the API
33 © NETWAYS
Lab 8.2: Working with the CLI
Objective:
Steps:
Associate the template "Kickstart default PXELinux" and set it as default template
34 © NETWAYS