Getting Started With Foreman - Part 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.

org

BERYJU.ORG 

Enov8 IT

Model, Plan, C
Measure your
Operations.
Enov8 Limited

Getting Started with Foreman: Part 1 03


JUL
FOREMAN PROVISIONING GETTING-STARTED-WITH TUTORIAL VMWARE ESXI DEBIAN

DHCP DNS TFTP GETTING-STARTED-WITH-FOREMAN

What is Foreman

From their website:

Foreman is a complete lifecycle management tool for physical and virtual


servers. We give system administrators the power to easily automate repetitive
tasks, quickly deploy applications, and proactively manage servers, on-premise
or in the cloud.

This is a multi-part series about provisioning and automating things with Foreman. It's going
cover deploying Debian, Windows (7/10/Server) and ESXi as well as automating things like
Package installs.

Since I am using VMWare, this tutorial is going to involve integration with vCenter and ESXi.
Foreman supports Bare metal, Amazon EC2, Google Compute Engine, OpenStack, Libvirt
and oVirt, so if you use any of those some of the instructions won't match up.

https://beryju.org/en/blog/getting-started-foreman-part-1 1/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

Table of Contents
BERYJU.ORG 

Part 1: Getting Started


Installing the OS
Installing Foreman
Settings Foreman up
Creating our rst VM
Part 2: Deploying Windows 7/10/Server
Installing and Con guring the WDS Server
Installation and Basics of MDT 2013u2
Integrating it with Foreman (the Windows side)
Integrating it with Foreman (the Foreman side)
Deploying our rst Windows VM
Part 3: Deploying ESXi
Preparation of the Source
Creating templates
Integrating it with vCenter
Deploying our rst ESXi Box
Part 4: Getting Started with Puppet
Part 5: Advanced Puppet

Installing Foreman
Installing the OS

In this case I am going to give the Foreman VM 1 vCPU and 2 GB of RAM as well as 25 GB of
HDD Space. The Specs are very dependent on the amount of hosts you are managing with
puppet. For my production Foreman VM, which has about 50 hosts checking in, I provisioned
3 vCPUs and 4 GB of RAM.

https://beryju.org/en/blog/getting-started-foreman-part-1 2/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

Since this will deploy machines over DHCP, I am going to set a static IP. Also since we don't
have a DNS Server yet (let's assume), I am going to set it to the Google DNS

https://beryju.org/en/blog/getting-started-foreman-part-1 3/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

The hostname for this test box is war-dev-puppet01.beryju.org, but don't let that puppet
throw you o . I chose to use puppet instead of foreman since it ts better in my naming
Scheme. For partitioning I am going to go with a single Partition.

Looking good so far!

Installing Foreman
https://beryju.org/en/blog/getting-started-foreman-part-1 4/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

Now we're going to actually start installing Foreman itself.


BERYJU.ORG 

echo "deb http://deb.theforeman.org/ jessie stable" > /etc/apt/sources.list.d


echo "deb http://deb.theforeman.org/ plugins stable" >> /etc/apt/sources.list
apt-get -y install ca-certificates
wget -q https://deb.theforeman.org/pubkey.gpg -O- | apt-key add -
wget -q https://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb
dpkg -i https://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb
rm puppetlabs-release-pc1-jessie.deb
apt-get update && apt-get -y install foreman-installer foreman-vmware
foreman-installer
puppet agent -t

Dependant on your distribution, you might need to adjust that jessie. This adds the Foreman
APT Repository, installs their public GPG Key and installs the foreman-installer Package.
This package installs Foreman, Foreman Smart Proxies and everything else needed.

This should be the result we get after running above commands. Now we can access the
Web Interface of Foreman, which is listening on https://<ip>. First time authentication
happens with the credentials provided after the installation. You probably want to change
your password to something you can actually remember. To do that, you click on Admin User
on the Top Bar, My Account and change it there.

Setting up Foreman

https://beryju.org/en/blog/getting-started-foreman-part-1 5/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

Now that we have everything installed, let's start setting Foreman up for provisioning. To start
BERYJU.ORG 
that process, we go to Infrastructure and then Provisioning setup. On that page we select
a Network adapter for the provision network. This will most likely stay on eth0.

On the next page we ll in some information about our network, which look like this in my
example:

On the next page we are going to copy and execute the rst snippet, which re-con gures
Foreman with a Smart-Proxy, a DHCP Server and a TFTP Server. After the installer is done,
we should get a similar output to earlier. But don't reload the webpage, since we are not
quite done with the wizard yet. Click on Next to continue and Choose an OS Mirror. Since I am
using Debian 8 in this case, I am going to keep the o cial Debian Mirror. Click Submit once
again and we're done with the provisioning setup (mostly).

We need to do one nal thing before we can use Foreman to create and provision VMs.
Navigate to Infrastructure, Compute Resources and select New. Here we can add our vCenter
or ESXi connection, which looks like this in my case:

https://beryju.org/en/blog/getting-started-foreman-part-1 6/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

Ok I lied. One more thing we have to do before creating our rst VM. We have to set our
Foreman box as DNS Proxy for the Domain we're using. This is done by going to
Infrastructure -> Domains -> <your domain> -> DNS Proxy. The reason why we set this is so
that Foreman creates A Records for our VMs as well as PTR Records.

Creating our first VM

Alright, enough setting up. Let's create a VM to test if everything works. Go to Hosts -> New
host. For this VM it should look something like this (obviously with your Hostnames)

https://beryju.org/en/blog/getting-started-foreman-part-1 7/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

Switch over to the Interfaces tab to con gure the VMs Interfaces. Click Edit on the rst
Interface to change the Domain, Subnet and Portgroup, which you might need to change.
Over on the Operating System tab, all we have to do is set the root password. On the Virtual
Machine Tab we have to set the VM Host/Cluster as well as the datastore. Let's start the
creating by clicking Submit and cross our ngers!

If all goes well, it should look something like this

https://beryju.org/en/blog/getting-started-foreman-part-1 8/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

Now it's time to grab a co ee and read some /r/homelab until the install nishes.

After about 10-15 mins, it should be done with the install, and if all goes well, this is what the
host page should look like now.

https://beryju.org/en/blog/getting-started-foreman-part-1 9/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG  Next Post Previous Post  

Search

Search …

Related Posts

My Thoughts about Puppet 4 100

Upgrading to ESXi 6.5 on HP gear 90

BeryJu.org goes Colo 60

IPv6 and online.net 50

Setup Walkthrough 45

Popular Tags

MONTH-THEMED TUTORIAL VMWARE ESXI FOREMAN MUCKING-ABOUT

GETTING-STARTED-WITH-FOREMAN TFTP DNS DHCP GETTING-STARTED-WITH PROVISIONING

HOMELAB SETUP DEBIAN ERROR VCENTER VYOS ESXI 6.5 ACTIVE DIRECTORY

https://beryju.org/en/blog/getting-started-foreman-part-1 10/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BATTLESTATION HARDER-THAN-USUAL DRUM-AND-BASS


BERYJU.ORG 
N3SSO5FAULT13INTERNALFAULT9EXCEPTIONE UK-GARAGE DOMAIN GARAGE VSPHERE

ONLINE.NET IPV6 PUPPET VSPHERE 6.5

Archives

3 November 2019

1 June 2017

3 July 2016

1 May 2016

1 March 2016

Syndicate

 Atom 1.0  RSS

https://beryju.org/en/blog/getting-started-foreman-part-1 11/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 


Privacy Policy

https://beryju.org/en/blog/getting-started-foreman-part-1 12/13
04/03/2020 Getting Started with Foreman: Part 1 | BeryJu.org

BERYJU.ORG 

Instant secu
13 risk fact
Get My Free Score
SSL & DNS

https://beryju.org/en/blog/getting-started-foreman-part-1 13/13

You might also like