Ask Your Question
1

Puppet 4 facts hierarchies?

asked 2017-09-07 15:56:02 -0600

deric gravatar image

I have a node with Debian 9 and system Puppet 4.8.2 which has following hierarchy:

operatingsystem: Debian
operatingsystemmajrelease: '9'
operatingsystemrelease: '9.1'
os:
  name: Debian
  family: Debian
  release:
    major: '9'
    minor: '1'
    full: '9.1'
  lsb:
    distcodename: stretch
    distid: Debian
    distdescription: Debian GNU/Linux 9.1 (stretch)
    distrelease: '9.1'
    majdistrelease: '9'
    minordistrelease: '1'
osfamily: Debian

but another node with Puppet 4.10.6 (from Puppetlabs apt repo) has this facts hierarchy:

os:
  architecture: amd64
  distro:
    codename: jessie
    description: Debian GNU/Linux 8.9 (jessie)
    id: Debian
    release:
      full: "8.9"
      major: "8"
      minor: "9"
  family: Debian
  hardware: x86_64
  name: Debian
  release:
    full: "8.9"
    major: "8"
    minor: "9"

The question is what is the reasoning for introducing new facts hierarchies when EVEN TWO minor Puppet releases for the same OS have different facts hierarchies?

How am I supposed to get variable that used to have name $::lsbdistcodename when on one machine it is $facts['os']['distro']['codename'] and on the other $facts['os']['lsb']['distcodename']? Why even bother with introducing something completely new which makes things much more complicated than before?

edit retag flag offensive close merge delete

Comments

I'm already utilizing branches (selectors) to work with multiple facter versions. If at some intermediate step while accessing the “modern” fact a value's `undef`, I fall back to the “legacy” fact. I like the modern facts, though. NB It's difficult to find common structure among OS version numbering

Kai Burghardt gravatar imageKai Burghardt ( 2017-09-07 18:11:24 -0600 )edit

Yeah, I like the new hierarchy too, it would just make much more sense do design facts in a consistent way.

deric gravatar imagederic ( 2017-09-13 08:03:49 -0600 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2017-09-15 05:32:18 -0600

deric gravatar image

The main problem turned out to be difference between puppet package in Debian, that depends on facter 2.4.6.

While puppet-agent 4.10.x from puppetlabs ships with facter 3.6.7.

At the time, when I was installing puppet on Debian 9, there was no official package available. Now there's official stretch package available:

wget https://apt.puppetlabs.com/puppetlabs-release-pc1-stretch.deb

(though, it's not really documented yet)

edit flag offensive delete link more
0

answered 2017-09-08 05:53:03 -0600

fvoges gravatar image

Do you have the LSB tools packages installed? The lsb facts are only available when the necessary tools are present and they are not installed by default in many distros.

edit flag offensive delete link more

Comments

I'm installing `lsb-release` in Debian before installing Puppet. Yeah, you're right it's not installed by default. Anyway it doesn't explain absence of `$facts['os']['distro']['codename']`.

deric gravatar imagederic ( 2017-09-13 07:59:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-09-07 15:56:02 -0600

Seen: 259 times

Last updated: Sep 15