4

I use Puppet to set up VMs from time to time. Sometimes I run Linux Mint on these VMs. I have a lot of Puppet modules I like to use, but when they check the LSB facts they recoil from the strange Linux Mint version.

For instance, I'm using the official Puppet Labs Java module to install the JDK and such. The params.pp file looks like this (I've cut out much of it):

class java::params {

  case $::osfamily {
    'RedHat': {...}
    'Debian': {
      case $::lsbdistcodename {
        default: { fail("unsupported release ${::lsbdistcodename}") }
        'lenny', 'squeeze', 'lucid', 'natty': {
          $java  = {
            'jdk' => {
              'package'          => 'openjdk-6-jdk'...
            },
            'jre' => {
              'package'          => 'openjdk-6-jre-headless...
            },
          }
        }
        'wheezy', 'jessie', 'precise','quantal','raring','saucy', 'trusty', 'utopic': {
             ...I could add 'rebecca' to the above list, and that would probably do it
          $java =  {
            'jdk' => {
              'package'          => 'openjdk-7-jdk'...
            },
            'jre' => {
              'package'          => 'openjdk-7-jre-headless'
            },
            'oracle-jre' => {...},
            'oracle-jdk' => {...},
          }
        }
      }
    }
...
    default: { fail("unsupported platform ${::osfamily}") }
  }

when I run the agent on the Mint instance, I eventually get:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: unsupported release rebecca at /etc/puppet/modules/java/manifests/params.pp:50 on node some.host.com

rebecca is the version of Linux Mint I'm dealing with at the moment, which corresponds to Ubuntu Trusty.

But each Mint version is based on a Ubuntu version, and that ought to work fine. (Fine enough to try, at least.) I'd really like to tell facter to return the equivalent Ubuntu lsb information, rather than modifying the module, and all the other modules like it. Although that might be a service to the community...

Has someone tried to solve this problem? Ideas?

Ladlestein
  • 241
  • 3
  • 8
  • 6
    AFAIK Mint is hardly ever used as a distro for servers, which is what puppet is most often used to manage. You could certainly fix it and submit a pull request to have your changes merged into the [main project](https://github.com/puppetlabs/puppetlabs-java). Or you might try bring an issue up in directly with the maintainers to see if they would accept that kind of change. – Zoredache Jan 09 '15 at 00:55
  • 1
    Yeah, pretty sure you're right, @Zoredache. I did think though that Puppet was also used to set up desktops for incoming staff, so I hoped that there would be support. – Ladlestein Jan 09 '15 at 06:30

1 Answers1

1

This page seems to imply you can override Facter facts by setting an environment variable:

# show the operating system we are running (retrieved from facter)
$ puppet -e 'notify { "We are running on $operatingsystem": }'
notice: We are running on Fedora

# override $operatingsystem for testing purposes
$ FACTER_operatingsystem=Debian puppet -e 'notify { "We are running on $operatingsystem": }'
notice: We are running on Debian

In which case, would you be able to build each rebecca host with the variable FACTER_lsbdistcodename=trusty?

I've not tested this, but facts are simply things reported by the node, and as such should be easily overrideable/editable...

shearn89
  • 3,143
  • 2
  • 14
  • 39
  • 1
    I'd found this; should have posted the answer. It works for me. Although it's not necessary as I have abandoned Mint for the moment and gone back to Ubuntu :-) – Ladlestein Feb 05 '15 at 08:25