Ubuntu 12.04 (Precise) Brightbox migration

For Foreman 1.7, we want to drop support for Ruby 1.8 and Ubuntu 12.04 is the last OS (of the six supported in 1.7) to run the Foreman application under 1.8 (note, this excludes the smart proxy, Puppet and installer). This is being tracked under #4656 and #7227. This change will mean Foreman 1.8 can move to Rails 4 and use newer versions of various libraries that have also dropped support. It will probably also provide a decent performance improvement.

We're proposing:

  1. The Brightbox Ruby NG PPA will be required, a well-regarded source of Ruby 1.9.3 packages
  2. Puppet 3.0.0 or higher and facter_1.6.12-1puppetlabs2 or higher from Puppet Labs (community repos) will be required on the master
    • Older Puppet clients can talk to a newer master, so there's no need to update clients if you don't want to

Why replace Ruby with Brightbox?

Ubuntu 12.04 ships with a dual stack of Ruby 1.8 and 1.9.3, however the 1.9 version is a "p0" (patch level zero) release and is known to contain a lot of bugs. Puppet isn't supported on p0 due to known issues, and we are also likely to encounter problems.

Brightbox's Ruby NG PPA offers newer Ruby 1.9.3 builds which also contain a number of performance enhancing patches.

Why require a newer Puppet and Facter?

When Foreman and the Puppet master are on the same server, and Puppet is configured to run under Passenger (the default Foreman installation), then they usually do so under the same Ruby binary (at least, in Passenger 2 and 3).

If we switch Passenger to use Ruby 1.9.3, it has to be able to load Puppet and Facter too. In Ubuntu 12.04 distro packages and early Puppet Labs packages, Puppet and Facter are packaged under /usr/lib/ruby/1.8, so Ruby 1.9.3 simply won't be able to load them from that path.

Since Puppet 3.0.0 and Facter 1.6.12 (-1puppetlabs2), Puppet Labs packages are under /usr/lib/ruby/vendor_ruby, which both Ruby 1.8 and 1.9.3 will load from.

If your Puppet master is not on the same server (same Passenger instance) as Foreman, then this doesn't matter, it can be older.

Also note that older Puppet clients can talk to a newer master, so there's no need to update clients if you don't want to.

New installations

Foreman installer will be updated to configure the Brightbox PPA and configure Passenger appropriately to load Ruby 1.9.3.

Users will need to configure the Puppet Labs repo before installing the installer, as we'll probably bump the min version required on the package to 3.0.0/1.6.12.


  1. add-apt-repository ppa:brightbox/ruby-ng
  2. upgrade Foreman as usual
  3. apt-get install libaugeas-ruby1.9.1

This will have the effect of installing Ruby 1.9, switching the default version and having everything run under 1.9.

Upgrading from Puppet 2 to 3

If you're on Puppet 2 and now need to move to 3, do the following:

  1. Be aware that Puppet 3 includes some breaking changes, including removal of dynamic scoping. See breaking changes for details.
  2. Add the Puppet Labs repo: instructions
  3. Upgrade the puppet* packages
  4. Change /etc/sudoers.d/foreman-proxy as per the FAQ
  5. Change /etc/puppet/rack/config.ru as per the Puppet release notes

What about other operating systems?

Ubuntu 14.04 (trusty) and Debian 7 (wheezy) both use Ruby 1.9 as standard already.

Debian 6 (squeeze) has a similar dual 1.8/1.9.2 stack, but is in LTS phase. Foreman 1.7 won't support it as there isn't an equivalent to the Brightbox PPA. Users should update to Debian 7 (wheezy).

EL6/EL7 both use Ruby 1.9.3 via Software Collections (SCL), and Fedora 19 uses Ruby 2.0.


Install libaugeas-ruby1.9.1

As the default Ruby is now 1.9.3, the Puppet agent will also run under this version so needs a matching Augeas/Ruby library (you'll get "Could not find a suitable provider for augeas" otherwise).

apt-get install libaugeas-ruby1.9.1

Default Ruby needs to be 1.9.3

It should be possible to switch the default Ruby version back to 1.8 to support other apps, but shebang lines in /usr/sbin/foreman-rake need fixing to point at 1.9.3.

The PassengerRuby setting also needs adding to the Apache virtualhosts to load the right interpreter.

Advanced options

If you're feeling brave (you get to keep the pieces if it breaks), there are a couple of advanced options which avoid the need to upgrade Puppet.

Passenger 4

Enable the Phusion Passenger repo and install Passenger 4.

You can then configure the Apache virtualhosts to have different PassengerRuby settings, so the Puppet virtualhost can run on Ruby 1.8 (and use the older distro Puppet package) and Foreman can run on 1.9.

Force loading from 1.8 paths

You can force both Puppet and Foreman to load Puppet/Facter from their 1.8 installation paths, even though they're running under 1.9.

Edit both /etc/puppet/rack/config.ru and /usr/share/foreman/config/application.rb, and add at the top:

$: << '/usr/lib/ruby/1.8'