How to Install Foreman on Ubuntu 16.04 LTS
Foreman is a free and open source tool which helps you with configuration and management of physical and virtual servers. Foreman also helps you to provision and monitor your server.
- An Ubuntu 16.04 LTS x64 server instance.
- A sudo (or root account) user.
Update your system before installing Foreman.
apt-get update && apt-get upgrade
Setup a Hostname
You'll have to edit the
/etc/hosts file using any text editor.
Add your server.
198.51.100.0 server.vultr.local server
Save the file and exit from the text editor.
Next, you'll need to setup a hostname. On Ubuntu we can use
hostnamectl set-hostname server.vultr.local
Note: The above commands are examples. You should change them to your own.
The Foreman installer is a collection of Puppet modules that installs everything required for a fully working Foreman setup.
Now let's configure the EPEL, Puppet and Foreman repositories.
echo "deb http://deb.theforeman.org/ xenial 1.12" > /etc/apt/sources.list.d/foreman.list echo "deb http://deb.theforeman.org/ plugins 1.12" >> /etc/apt/sources.list.d/foreman.list apt-get -y install ca-certificates wget -q https://deb.theforeman.org/pubkey.gpg -O- | apt-key add -
Install the Foreman installer so that it can install Foreman and all of its required packages.
apt-get update && apt-get -y install foreman-installer
Execute the Foreman installer.
You will see
Success upon completion of the installation.
Execute following commands one by one.
ufw allow 53/tcp ufw allow 67-69/udp ufw allow 80/tcp ufw allow 443/tcp ufw allow 3000/tcp ufw allow 3306/tcp ufw allow 5910-5930/tcp ufw allow 5432/tcp ufw allow 8140/tcp ufw allow 8443/tcp
Enable the firewall services.
The firewall will prompt a dialog to accept changes. Press Y
Command may disrupt existing ssh connections. Proceed with operation (y|n)?
Open up your web browser and visit
http://FQDN to access the Foreman web interface. You will see a login webpage, so enter your Foreman username and the password we created earlier,
mysupersecretpassword, and then click the
Install NTP Module
NTP module is one of the most important requirements of Puppet for managing the NTP services.
puppet module install -i /etc/puppet/environments/production/modules saz/ntp
In the Foreman web console, go to
Configure > Puppet > Classes and click on
Import from hostname (server.vultr.local) to read the available Puppet classes from the puppet master and populate Foreman’s database.
Select the NTP module and click on the
Now you can manage NTP module and Foreman from its dashboard.