Bring order to the system jungle with Foreman

Pitfalls

Another trap that the test team fell into concerned the database during installation. The Foreman installer installs it by default on its own, so you don't have to install it yourself or start a separate instance. The testers chose an all-in-one installation to disk, which included Puppet; DHCP, DNS, and TFTP servers; the smart proxy; and Foreman.

To do this, you need to let the Puppet agent run on the Foreman server once after the installation so that the server can become acquainted with its own setup and especially its network. After that, the start screen provides a wizard that lets you adjust the connected network, and therefore DNS and DHCP. To this end, the foreman-install command lines are then output again to expand the installation and add the missing components.

In Foreman, a number of components interact to install a host. The first step is to configure an installation source; this can be an NFS share or just a URL. The URL can be parameterized to use a wildcard for version numbers (e.g., both Debian 6 and 7 can be installed by using a source definition).

Templates are already available for the most common distributions and operating systems, making the setup easier. If the CPU architectures are not already set, you also need to specify this (e.g., x86_64).

Configuring a Guest

The next step is to configure an operating system (i.e., a concrete instance with its own parameters), such as Ubuntu 14.04, and assigning the source to the operating system – the source is known as an image in Foreman. The operating system also needs an architecture and a partition table: Foreman has default partition table settings for the major operating systems; however, you need to be familiar with the way they are defined in Kickstart or Preseed, because they are parameterized text files. Finally, you can assign parameters such as an HTTP proxy to the operating system – these are then available in the templates.

Once you have created the operating system, you need to assign the templates. Foreman splits these into three categories: PXE (of several types), Provision, and Finish. The PXE templates ensure that the correct kernel for the installation ends up on the computers to be installed using DHCP and TFTP. You will find the installation instructions below Provision (e.g., a ks.cfg or Preseed file). Finally, Foreman can provide a script with Finish that executes tasks at the end of the installation that do not fit into the normal installation routine's framework.

Templates

To apply an operating system to a host, you need to assign appropriate templates, and you can create a new host once this assignment is complete. The templates supplied by Foreman are pretty good – Preseed installs both Ubuntu and Debian in several variants. You then need to go through several tabs in the host dialog (Figure 2). The hostname, the host group, the Puppet environment, the Puppet server, and the Puppet CA are specified on the first page. These will be empty if you do not want Puppet to manage the host.

Figure 2: Creating new machines in the Foreman Host dialog.

In the Network tab, you can adjust the DNS domain and subnet of the host so that Foreman knows which DHCP/TFTP server it is supposed to use. DNS entries are also created at the same time. You need to enter the host's MAC address in this dialog. You can either assign the IP address yourself or have the next available address suggested from the range of free addresses. Finally, you choose the operating system instance, the architecture, the installation medium, and the partition table in the Operating System tab, as well as the root password for the new host.

Now you're set. Foreman lets the TFTP and DHCP servers roll out the configuration until the Finish script terminates successfully, unless you click on Cancel build. The templates supplied for systems based on Debian and Red Hat are quite mature. They immediately install Puppet and then set it up once a Puppet master (the Foreman server or a Puppet server managed by Foreman) is assigned to the host.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Red Hat Satellite 6

    Red Hat's Satellite system management solution provides an amazing range of capabilities, but it isn't quite ready for orbit.

  • Security Lessons: Admin Automation

    Combining Puppet, Foreman, Pulp, Candlepin, and Katello lets you deploy software and servers automatically and securely.

  • Puppet Labs Announces Puppet Enterprise

     

    Puppet Labs, provider of open source systems management solutions, announced the release of Puppet Enterprise, the first commercially supported version of Puppet.

  • Puppet Labs MCollective 1.0 Now Available

    “Our partners bring users the operating system, Amazon EC2 and OpenStack, as well as traditional hosted and in-house servers give users a platform to run that operating system, and Puppet with MCollective1.0 gives them ease of use and adds a layer of functionality that greatly improve the productivity of both the platform and the user.” Luke Kanies

  • Puppet

    Learn how to save time and streamline your system administration with the help of Puppet, a centralized configuration management tool.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News